/* group/css/group_theme.css */
/* Premium, warm, weniger eintönig – nur für Group-Seiten */

:root{
  --bg1:#e6e4df;
  --bg2:#cdcac2;

  --surface:#ffffff;
  --surface2:#fffcf8;

  --text:#1d1d1f;
  --muted:rgba(29,29,31,.62);
  --muted2:rgba(29,29,31,.48);

  --border:rgba(29,29,31,.10);
  --border2:rgba(29,29,31,.08);

  --primary:#7d9883;

  --shadow: var(--mv-public-shadow,0 18px 42px rgba(73,55,37,.12),0 4px 12px rgba(73,55,37,.06));
  --shadowSoft: 0 10px 30px rgba(0,0,0,.10);

  --r-lg:var(--mv-public-radius,24px);
  --r-md:16px;
  --r-sm:12px;

  --pad:18px;
}

*{ box-sizing:border-box; }

html{
  min-height:100%;
  margin:0;
  padding:0;
  background:var(--bg2);
  overflow-x:hidden;
}

body{
  min-height:100%;
  margin:0;
  padding:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background-color:var(--bg2);
  background-image:radial-gradient(circle at 50% 28%, var(--bg1) 0%, var(--bg2) 100%);
  background-repeat:no-repeat;
  background-attachment:scroll;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}



/* =========================================================
   GROUP VIEW: stabiler App-Container
   ---------------------------------------------------------
   In Firefox/Android verschwindet beim normalen Body-Scrollen
   die obere Browserleiste. Dadurch verändern sich Viewport-Maße
   und fixed-bottom-Elemente können sichtbar springen.

   Die Group View wird deshalb wie eine kleine App-Fläche behandelt:
   außen bleibt der Container stabil, nur der Karteninhalt scrollt.
   Der FAB liegt absolut innerhalb der Kartenfläche und nicht mehr am Browser-Viewport.
   ========================================================= */
body.group-view-page{
  height:100%;
  overflow:hidden;
  overscroll-behavior:none;
}

body.group-view-page .page{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
  overflow:hidden;
}

body.group-view-page .shell{
  height:100%;
  min-height:0;
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
}

body.group-view-page .card{
  flex:1 1 auto;
  height:auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}

body.group-view-page .header{
  flex:0 0 auto;
  position:relative;
  z-index:1;
  padding-bottom:14px;
}

/*
  Alles unterhalb der festen Überschrift scrollt gemeinsam:
  erklärender Text, leerer Zustand, Einträge und Load-More-Button.
*/
.group-scroll{
  position:relative;
  z-index:1;
}

body.group-view-page .group-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding-bottom:calc(96px + env(safe-area-inset-bottom, 0px));
}

body.group-view-page .section{
  overflow:visible;
  padding-bottom:18px;
}

body.group-view-page .group-scroll::-webkit-scrollbar{
  width:8px;
}
body.group-view-page .group-scroll::-webkit-scrollbar-track{
  background:transparent;
}
body.group-view-page .group-scroll::-webkit-scrollbar-thumb{
  background:rgba(29,29,31,.16);
  border-radius:999px;
}

/* Sanfte Textur */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  opacity:.10;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.22) 0px,
      rgba(255,255,255,.22) 1px,
      transparent 1px,
      transparent 6px
    );
  mix-blend-mode: overlay;
  z-index: 0;
}

/* --- Page layout --- */
.page{
  min-height:100vh;
  min-height:100svh; /* bewusst kein 100dvh: verhindert Sprünge, wenn Mobile-Browserleisten beim Scrollen ein-/ausblenden */
  display:flex;
  justify-content:center;
  padding: max(var(--mv-public-gutter,18px),env(safe-area-inset-top,0px)) max(var(--mv-public-gutter,18px),env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(var(--mv-public-gutter,18px),env(safe-area-inset-left,0px));
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

.shell{
  width:min(var(--mv-public-wide-max,940px),100%);
  display:flex;
  flex-direction:column;
  align-items:center;
}

/* --- Main card --- */
.card{
  width:100%;
  max-width: 100%;
  border-radius: var(--r-lg);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.56);
  box-shadow: var(--shadow);
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(125,152,131,.18), transparent 70%),
    linear-gradient(to bottom, var(--surface2), var(--surface));
  position: relative;
}

.card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(600px 180px at 20% 0%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(600px 180px at 80% 0%, rgba(255,255,255,.55), transparent 60%);
  pointer-events:none;
  opacity:.55;
}

.inner{
  position:relative;
  z-index:1;
}

/* --- Header --- */
.header{
  padding: 26px 22px 12px;
  text-align:center;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a7a5a;
  background: linear-gradient(135deg, #fdfbf7, #f7f3ea);
  border: 1px solid rgba(212,175,55,.25);
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
  margin-bottom: 14px;
}

.badge-dot{
  width:8px; height:8px;
  border-radius:50%;
  background: rgba(125,152,131,.85);
  box-shadow: 0 0 0 4px rgba(125,152,131,.15);
}

.h1{
  margin:0;
  font-family:"Georgia","Times New Roman",serif;
  font-weight:400;
  font-size: clamp(1.55rem, 5vw, 2.2rem);
  letter-spacing:-0.02em;
  line-height:1.12;
  color:#1a1a1a;
}

.recipient{
  display:block;
  margin-top: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: .58em;
  line-height:1.18;
  font-weight: 900;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.sub{
  margin: 10px auto 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: .98rem;
  line-height:1.55;
}

.group-scroll-sub{
  margin-top:0;
  padding:0 22px 4px;
  text-align:center;
}

/* Divider */
.divider{
  width: min(680px, 92%);
  height: 1px;
  margin: 12px auto 0;
  background: linear-gradient(to right, transparent, rgba(0,0,0,.10), transparent);
}

/* --- Status row --- */
.status-row{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  padding: 12px 18px 0;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .92rem;
}

@supports (backdrop-filter: blur(6px)){
  .chip{ backdrop-filter: blur(5px); }
}

.chip strong{ color: var(--text); font-weight:900; }
.chip-ico{
  width: 22px; height: 22px;
  border-radius: 8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(125,152,131,.14);
  color: rgba(125,152,131,.95);
  font-weight: 900;
}

/* --- Alerts / notices --- */
.notice{
  margin: 12px 18px 0;
  border-radius: 14px;
  padding: 10px 12px;
  text-align:center;
  font-size: .98rem;
  line-height:1.42;
  border: 1px solid rgba(242,209,151,.95);
  background: #fff8e6;
  color: #7a5a15;
  box-shadow: 0 2px 10px rgba(255,200,100,.18);
}

.notice-success{
  border-color: rgba(125,152,131,.35);
  background: rgba(125,152,131,.12);
  color: rgba(29,29,31,.85);
}

/* --- Sections --- */
.section{ padding: 18px; }

.section-title{
  margin:0 0 6px;
  text-align:center;
  font-size: 1.12rem;
  font-weight: 950;
  letter-spacing: -0.01em;
  color:#1a1a1a;
}

.section-hint{
  margin:0 0 14px;
  text-align:center;
  color: var(--muted);
  font-size: .95rem;
  line-height:1.45;
}

/* Panel */
.panel{
  width:100%;
  margin: 0 auto;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  overflow:hidden;
}

.panel-pad{ padding: 14px; }

/* --- Form --- */
.form{
  width: min(560px, 100%);
  margin: 0 auto;
}

.label{
  display:block;
  margin: 10px 0 6px;
  font-weight: 950;
  color:#1a1a1a;
  text-align:center;
}

.input, .textarea{
  width:100%;
  max-width: 100%;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  padding: 12px 14px;
  font-size: 1rem;
  outline:none;
}

.textarea{
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus, .textarea:focus{
  border-color: rgba(125,152,131,.55);
  box-shadow: 0 0 0 4px rgba(125,152,131,.14);
}

.mv-field-invalid{
  border-color:#b65e57 !important;
  box-shadow:0 0 0 4px rgba(182,94,87,.13) !important;
}

/* File */
.file-input{
  position:absolute;
  left:-9999px;
  width:1px; height:1px;
  opacity:0;
  pointer-events:none;
}

.file-row{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 10px;
}

.file-name{
  margin-top: 8px;
  min-height: 18px;
  text-align:center;
  color: rgba(29,29,31,.55);
  font-size: .92rem;
  line-height:1.35;
}
.file-name.is-error{
  color:#7a5a15;
  background:#fff8e6;
  border:1px solid rgba(242,209,151,.95);
  border-radius:12px;
  padding:8px 10px;
  box-shadow:0 2px 10px rgba(255,200,100,.16);
}

.file-meta{
  text-align:center;
  color: var(--muted2);
  font-size: .9rem;
  margin-top: 6px;
}

/* Indeterminate Progress */
.upload-progress{
  display:none;
  width: min(420px, 100%);
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  overflow:hidden;
  margin: 12px auto 0;
  border: 1px solid rgba(0,0,0,.08);
}
.upload-progress.show{ display:block; }
.upload-bar{
  height:100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(125,152,131,.25), rgba(125,152,131,.90), rgba(125,152,131,.25));
  animation: indeterminate 1.1s ease-in-out infinite;
}
@keyframes indeterminate{
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:none;
  border-radius: 999px;
  min-height:46px;
  padding:12px 16px;
  font-weight:950;
  cursor:pointer;
  text-decoration:none;
  transition: transform .15s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select:none;
  position: relative;
}

.btn:active{ transform: translateY(1px); }

.btn-primary{
  width:100%;
  margin-top: 12px;
  color:#fff;
  background: linear-gradient(135deg, rgba(125,152,131,.95), rgba(125,152,131,.78));
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

.btn-primary:hover{ filter: brightness(1.03); }

.btn-secondary{
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.10);
  color: rgba(29,29,31,.80);
}

.btn-ghost{
  background: transparent;
  border: 1px dashed rgba(0,0,0,.18);
  color: rgba(29,29,31,.72);
}

/* Button Spinner */
.btn-spinner{
  display:none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.38);
  border-top-color: rgba(255,255,255,.95);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg); } }

.btn.is-loading .btn-spinner{ display:inline-block; }
.btn.is-loading .btn-label{ opacity: .92; }
.btn.is-loading{ filter: saturate(1.02); }

/* FIX: saving-hint darf NIE initial sichtbar sein */
.saving-hint{
  display:none !important;
  margin: 10px auto 0;
  text-align:center;
  color: rgba(29,29,31,.62);
  font-size: .92rem;
}
.saving-hint.show{
  display:block !important;
}

/* =========================================================
   JOIN-LISTE (group.php) – Entries (Thumbnail + Preview)
   ========================================================= */
.entries-wrap{
  width: min(760px, 100%);
  margin: 0 auto;
}

.entries{
  display:grid;
  gap: 12px;
}

.entry{
  border-radius: var(--r-md);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 10px 24px rgba(0,0,0,.05);
  overflow:hidden;
}

.entry-top{
  padding: 12px 12px 6px;
}

.entry-head{
  display:flex;
  align-items:center;
  gap: 12px;
}

.entry-thumb{
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.10);
  background: #f3f3f3;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  flex: 0 0 auto;
}

.entry-thumb--empty{
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.86), transparent 42%),
    linear-gradient(135deg, rgba(247,243,237,.96), rgba(232,225,216,.88));
  border:1px solid rgba(125,152,131,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 6px 18px rgba(73,55,37,.055);
  color: rgba(125,152,131,.92);
  font-weight:950;
  font-size:1.05rem;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.entry-meta{ min-width: 0; }
.entry-name{
  font-weight: 950;
  color:#1a1a1a;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Datum/Uhrzeit ausblenden (falls noch im HTML) */
.entry-date{ display:none !important; }

.entry-body{
  padding: 0 12px 12px;
}

.entry-preview{
  margin-top: 4px;
  color: rgba(29,29,31,.78);
  line-height: 1.45;
  font-family:"Georgia","Times New Roman",serif;

  display:-webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow:hidden;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-actions{
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,.06);
  display:flex;
  justify-content:center;
}

/* Falls irgendwo noch die alte Vollbild-Entry-Media drin ist */
.entry-media{ display:none !important; }
.entry-img{ display:none !important; }

/* =========================================================
   VIEW (group_view.php) – Premium Tiles (Thumbnail + Name + Preview)
   ========================================================= */
.masonry{
  width: min(980px, 100%);
  margin: 0 auto;
  display:grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px){
  .masonry{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .masonry{ grid-template-columns: 1fr; }
}

/*
 * Every group entry tile should have a consistent height so that the
 * masonry/grid layout does not appear uneven. By default the tile
 * grows to fit its content; here we impose a minimum height that is
 * sufficient to accommodate the thumbnail, two lines of name text,
 * a four‑line preview and the action button. Using flexbox allows
 * the message preview to shrink if necessary. See readme for sizing.
 */
.tile{
  border-radius: var(--r-md);
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 10px 24px rgba(0,0,0,.05);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  /* Ensure tiles are visually uniform by enforcing a minimum height.
   * On larger screens the height is clamped between 240px and 320px.
   */
  min-height: clamp(240px, 32vw, 320px);
}

/* Kopfzeile mit Thumbnail links */
.tile-top{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 12px 0;
}

.tile-thumb{
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.10);
  background: #f3f3f3;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  flex: 0 0 auto;
}

.tile-thumb--empty{
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.86), transparent 42%),
    linear-gradient(135deg, rgba(247,243,237,.96), rgba(232,225,216,.88));
  border:1px solid rgba(125,152,131,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 6px 18px rgba(73,55,37,.055);
  color: rgba(125,152,131,.92);
  font-weight:950;
  font-size:1.05rem;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.tile-top-meta{ min-width:0; }

.tile-name{
  font-weight: 950;
  color:#1a1a1a;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
  /* Prevent the sender name from wrapping onto too many lines. Limiting
   * to two lines ensures all tiles remain the same height. Extra
   * characters are clipped. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Falls in alten Versionen noch Fullsize img genutzt wird => hart ausblenden */
.tile-img{ display:none !important; }
.tile-head{ display:none !important; }

.tile-body{
  padding: 10px 12px 12px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.tile-msg{
  color: rgba(29,29,31,.78);
  line-height: 1.45;
  font-family:"Georgia","Times New Roman",serif;

  display:-webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow:hidden;

  overflow-wrap:anywhere;
  word-break: break-word;
}

.tile-more{
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 950;
  cursor:pointer;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.85);
  color: rgba(29,29,31,.80);
  transition: transform .15s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
  /* Push the action button to the bottom of its tile. This ensures a
   * consistent layout across entries regardless of message length. */
  margin-top: auto;
}

.tile-more:active{ transform: translateY(1px); }
.tile-more:hover{ filter: brightness(1.02); }

/* Empty State (group_view.php) */
.empty{
  width: min(680px, 100%);
  margin: 0 auto;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  padding: 16px;
  text-align:center;
}
.empty-icon{
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.empty-title{
  margin:0;
  font-weight: 950;
  color:#1a1a1a;
}
.empty-sub{
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}


/* --- Modal --- */
.modal{
  position:fixed;
  inset:0;
  z-index:3000;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(6px);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.modal-card{
  width: min(740px, 94vw);
  max-height: calc(100svh - 36px);
  background:#fff;
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0,0,0,.30);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  overscroll-behavior: contain;
}

.modal-top{
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.modal-title{
  font-weight: 950;
  color:#1a1a1a;
}

.modal-meta{ display:none !important; }
.modal-meta:empty{ display:none !important; }

.modal-close{
  border:none;
  background: transparent;
  cursor:pointer;
  font-size: 1.7rem;
  line-height:1;
  color: rgba(0,0,0,.55);
  padding: 4px 10px;
}

.modal-body{
  padding: 14px 16px 16px;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  flex:1 1 auto;
  min-height:0;
}

.modal-img{
  display:none;
  width:100%;
  max-height: 46svh;
  height:auto;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background:#f7f7f7;
  margin-bottom: 12px;
  object-fit: contain;
}

.modal-msg{
  white-space: pre-wrap;
  line-height:1.62;
  color: rgba(29,29,31,.85);
  font-family:"Georgia","Times New Roman",serif;

  overflow-wrap: anywhere;
  word-break: break-word;
}

/* FAB is intentionally styled in includes/partials/view_edit_fab.php.
   In der öffentlichen Group View wird er wie in den anderen Views innerhalb
   der Kartenfläche verankert. */

@media (prefers-reduced-motion: reduce){
  .btn{ transition: none; }
  .upload-bar{ animation: none; }
  .btn-spinner{ animation: none; }
  body::before{ display:none; }
}

/* --- Moment share / invitation polish --- */
.share-hero-card{
  width:min(680px,100%);
  margin:0 auto;
  padding:16px;
  border-radius:22px;
  border:1px solid rgba(125,152,131,.18);
  background:
    radial-gradient(circle at 20% 0%, rgba(125,152,131,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,252,248,.72));
  box-shadow:0 14px 34px rgba(73,55,37,.08);
  text-align:center;
}
.share-hero-kicker,
.moment-info-label{
  color:var(--muted2);
  font-size:.76rem;
  font-weight:950;
  letter-spacing:.11em;
  text-transform:uppercase;
}
.share-link-display{
  margin:10px 0 0;
  padding:13px 14px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.86);
  color:var(--text);
  font-size:clamp(.94rem, 3.4vw, 1.08rem);
  font-weight:850;
  overflow-wrap:anywhere;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
.share-actions-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:12px;
}
.moment-info-grid{
  width:min(680px,100%);
  margin:14px auto 0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.moment-info-card{
  border-radius:18px;
  border:1px solid rgba(0,0,0,.07);
  background:rgba(255,255,255,.72);
  box-shadow:0 8px 24px rgba(73,55,37,.055);
  padding:13px;
  text-align:center;
}
.moment-code{
  margin-top:5px;
  font-size:1.08rem;
  font-weight:950;
  letter-spacing:.08em;
  color:var(--primary);
  overflow-wrap:anywhere;
}
.moment-info-value{
  margin-top:5px;
  font-weight:900;
  color:var(--text);
}
.moment-copy-mini,
.notice-copy{
  margin-top:8px;
  border:0;
  border-radius:999px;
  padding:8px 12px;
  cursor:pointer;
  font-weight:900;
  color:rgba(29,29,31,.78);
  background:rgba(255,255,255,.78);
  border:1px solid rgba(0,0,0,.08);
}
.group-created-note{ margin-top:14px!important; }
.sr-copy-input{
  position:fixed;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.empty--invite,
.empty--compact{
  background:
    radial-gradient(circle at 50% 0%, rgba(125,152,131,.13), transparent 42%),
    rgba(255,255,255,.74);
}
.empty-actions{
  margin-top:14px;
  display:grid;
  gap:10px;
  grid-template-columns:1fr;
}
.group-success-share{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.group-success-share strong{ color:rgba(29,29,31,.86); }
.group-success-share span{ color:var(--muted); }
.toast{
  position:fixed;
  left:50%;
  bottom:calc(18px + env(safe-area-inset-bottom));
  transform:translateX(-50%) translateY(12px);
  z-index:5000;
  max-width:min(420px, calc(100vw - 28px));
  padding:10px 14px;
  border-radius:999px;
  background:rgba(29,29,31,.88);
  color:#fff;
  font-size:.92rem;
  font-weight:760;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  text-align:center;
  box-shadow:0 12px 30px rgba(0,0,0,.20);
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.group-portal-card{ max-width:680px; }
.group-portal-panel{ width:min(520px,100%); margin:0 auto; }
.group-portal-form .btn-primary{ margin-top:12px; }
.group-code-input{
  text-align:center;
  letter-spacing:.08em;
  font-weight:850;
  text-transform:uppercase;
}
.group-portal-domain{
  margin-top:14px!important;
  font-size:.88rem;
}
.group-portal-domain span{ color:var(--primary); font-weight:900; }

@media (min-width:640px){
  .share-actions-grid{
    grid-template-columns:1.1fr .95fr .95fr;
  }
  .empty-actions{
    grid-template-columns:1fr 1fr;
    max-width:520px;
    margin-left:auto;
    margin-right:auto;
  }
}
@media (max-width:520px){
  .moment-info-grid{ grid-template-columns:1fr; }
  .share-hero-card{ padding:14px; }
}


/* --- Own group entry actions --- */
.entry-owner-actions{
  width:100%;
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}
.entry-owner-actions[hidden]{
  display:none!important;
}
.entry-action-link{
  border:1px solid rgba(125,152,131,.18);
  background:rgba(255,255,255,.74);
  color:var(--primary);
  border-radius:999px;
  padding:7px 11px;
  cursor:pointer;
  font-size:.82rem;
  font-weight:850;
  line-height:1;
  box-shadow:0 4px 14px rgba(73,55,37,.045);
}
.entry-action-link:hover{
  border-color:rgba(125,152,131,.30);
  background:rgba(255,255,255,.92);
}
.entry-action-link--danger{
  color:#8F5A4A;
}
.entry-edit-form{
  padding:0;
  overflow:hidden;
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.entry-edit-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  padding:0 18px 16px;
}
.entry-edit-actions{
  position:sticky;
  bottom:0;
  z-index:8;
  flex:0 0 auto;
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);
  gap:10px;
  margin:0;
  padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(73,55,37,.10);
  background:rgba(255,255,255,.97);
  box-shadow:0 -12px 28px rgba(73,55,37,.10);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.entry-edit-actions .btn{
  width:100%;
  min-width:0;
  margin:0;
  min-height:48px;
  padding:11px 13px;
  line-height:1.15;
  text-align:center;
}
.entry-delete-form{
  display:none;
}

@media (max-width:520px){
  .entry-edit-scroll{
    padding:0 14px 14px;
  }
  .entry-edit-actions{
    gap:8px;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));
  }
  .entry-edit-actions .btn{
    font-size:.94rem;
  }
}
@media (min-width:520px){
  .entry-edit-actions{
    grid-template-columns:1fr 1fr;
  }
}

/* Group hardening and mobile interaction polish */
.group-char-count{
  margin:5px 3px 0;
  color:var(--muted2);
  font-size:.76rem;
  font-variant-numeric:tabular-nums;
  text-align:right;
}
body.mv-group-modal-open{overflow:hidden!important;touch-action:none;}
body.mv-group-modal-open .group-scroll{overflow:hidden!important;}
.modal-close:focus-visible,.tile-more:focus-visible,.entry-action-link:focus-visible,.btn:focus-visible{
  outline:3px solid rgba(125,152,131,.32);
  outline-offset:2px;
}
@media(max-width:520px){
  .modal{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));}
  .modal-card{width:100%;max-height:calc(100svh - 20px);border-radius:16px;}
}
