:root {
  --green: #123b2c;
  --green-2: #0a281e;
  --accent: #2f7d5b;
  --white: #ffffff;
  --soft: #f3f7f4;
  --line: rgba(18, 59, 44, 0.14);
  --muted: #65766f;
  --text: #10251d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.permissions-form { display:grid; gap:1.3rem; padding:1.25rem; }
.permissions-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; }
.permission-option { min-height:3.8rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.8rem 1rem; border:1px solid var(--line); border-radius:.65rem; background:#fff; font-weight:800; }
.permission-option input { width:1.25rem; height:1.25rem; flex:0 0 auto; accent-color:#123b2c; }
@media (max-width:600px) { .permissions-grid { grid-template-columns:1fr; } }

.shop-admin-form { display:grid; gap:1rem; padding:1.15rem; }
.shop-admin-form-head,.shop-order-detail-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.shop-admin-form-head h2,.shop-admin-list h2,.shop-order-detail h2 { margin:0; }
.shop-admin-fields { display:grid; grid-template-columns:2fr repeat(3,minmax(7rem,1fr)); gap:.75rem; }
.shop-admin-form label { display:grid; gap:.4rem; font-weight:800; }
.shop-admin-form input,.shop-admin-form textarea,.shop-order-status select { width:100%; border:1px solid var(--line); border-radius:.55rem; padding:.78rem; background:#fff; }
.shop-admin-form textarea { min-height:9rem; resize:vertical; }
.shop-image-upload { border:1px dashed rgba(18, 59, 44,.25); border-radius:.65rem; padding:1rem; background:#f7faf8; }
.shop-image-upload span { color:var(--muted); font-size:.82rem; font-weight:600; }
.shop-admin-images { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.6rem; }
.shop-admin-images > div { display:grid; gap:.35rem; }
.shop-admin-images img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:.5rem; background:#e9efeb; }
.shop-admin-list { margin-top:1.3rem; }
.shop-admin-product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin-top:.8rem; }
.shop-admin-product-grid > article { display:grid; grid-template-columns:6rem 1fr; gap:.85rem; border:1px solid var(--line); border-radius:.7rem; padding:.7rem; background:#fff; }
.shop-admin-cover { aspect-ratio:1; display:grid; place-items:center; overflow:hidden; border-radius:.5rem; background:#edf2ef; font-weight:900; }
.shop-admin-cover img { width:100%; height:100%; object-fit:cover; }
.shop-admin-product-grid h3 { margin:.25rem 0; }
.shop-admin-product-grid small { color:var(--accent); font-weight:850; }
.shop-admin-actions { grid-column:1/-1; display:flex; gap:.5rem; }
.shop-admin-actions form { margin-left:auto; }
.shop-order-filters { display:flex; gap:.45rem; overflow:auto; margin-bottom:1rem; padding-bottom:.35rem; }
.shop-order-filters a { flex:0 0 auto; border:1px solid var(--line); border-radius:999px; padding:.55rem .8rem; background:#fff; font-size:.78rem; font-weight:850; }
.shop-order-filters a.is-active { background:var(--green); color:#fff; }
.shop-order-detail { display:grid; gap:1rem; margin-bottom:1rem; padding:1rem; }
.shop-order-detail-head > div:first-child span { color:var(--muted); font-size:.75rem; font-weight:850; }
.shop-order-pin { display:grid; justify-items:end; }
.shop-order-pin span { color:var(--muted); font-size:.68rem; font-weight:850; text-transform:uppercase; }
.shop-order-pin strong { color:var(--green); font-size:2.3rem; letter-spacing:.1em; }
.shop-order-contact { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
.shop-order-contact p { display:grid; gap:.25rem; margin:0; border:1px solid var(--line); border-radius:.55rem; padding:.7rem; }
.shop-order-contact b { color:var(--muted); font-size:.7rem; text-transform:uppercase; }
.shop-order-items { display:grid; gap:.45rem; border-block:1px solid var(--line); padding:.75rem 0; }
.shop-order-items > div { display:flex; justify-content:space-between; gap:1rem; }
.shop-order-status { display:grid; grid-template-columns:1fr auto; align-items:end; gap:.7rem; }
.shop-order-status label { display:grid; gap:.35rem; font-weight:800; }
.shop-order-decisions { display:grid; grid-template-columns:1fr 1fr; gap:.65rem; }
.shop-order-decisions .button { min-height:3rem; font-weight:900; }
.shop-confirm-button { border-color:#17613b; background:#17613b; color:#fff; }
.shop-refuse-button { border-color:#b42318; background:#fff; color:#b42318; }
.shop-order-delete { display:flex; justify-content:flex-end; border-top:1px solid var(--line); padding-top:1rem; }
.shop-order-delete .button { border-color:rgba(180,35,24,.3); background:#fff; color:#b42318; font-weight:900; }
.shop-order-delete .button:hover { border-color:#b42318; background:#b42318; color:#fff; }
.shop-orders-list { display:grid; gap:.55rem; }
.shop-order-row { display:grid; grid-template-columns:9rem 1fr auto auto; align-items:center; gap:.8rem; border:1px solid var(--line); border-radius:.65rem; padding:.8rem; background:#fff; }
.shop-order-state { color:var(--accent); font-size:.72rem; font-weight:900; }
.shop-order-state.is-confirmata,.shop-order-state.is-finalizata { color:#17613b; }
.shop-order-state.is-refuzata,.shop-order-state.is-anulata { color:#b42318; }
.shop-order-row div { display:grid; gap:.2rem; }
.shop-order-row small,.shop-order-row time { color:var(--muted); font-size:.74rem; }
@media(max-width:700px){.shop-admin-fields,.shop-admin-product-grid,.shop-order-contact{grid-template-columns:1fr}.shop-admin-images{grid-template-columns:repeat(3,minmax(0,1fr))}.shop-order-row{grid-template-columns:1fr auto}.shop-order-state,.shop-order-row time{grid-column:1/-1}.shop-order-pin{justify-items:start}.shop-order-detail-head{align-items:flex-start;flex-direction:column}.shop-order-status{grid-template-columns:1fr}.shop-order-decisions{grid-template-columns:1fr}.shop-order-delete,.shop-order-delete .button{width:100%}}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

a, button, .bottom-nav, .menu-list {
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(47, 125, 91, 0.12), transparent 22rem),
    linear-gradient(180deg, #ffffff, #f3f7f4);
}

body.chat-open {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
  overscroll-behavior: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(22px);
}

.top-inner,
.app-main {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.3rem;
}

.brand img {
  display: block;
  width: 3rem;
  height: auto;
}

.top-title {
  color: var(--green);
  font-weight: 900;
}

.top-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-main {
  padding: 1.1rem 0 7.4rem;
  animation: pageIn 0.28s ease both;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-main > .page-head {
  display: none;
}

.page-head h1 {
  margin: 0;
  color: var(--green);
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
}

.muted {
  color: var(--muted);
}

.card,
.post-card,
.profile-hero,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 56px rgba(11, 48, 38, 0.08);
}

.feed {
  display: grid;
  gap: 1rem;
}

@media (max-width: 760px) {
  .feed {
    scroll-snap-type: y proximity;
  }
  .post-card {
    min-height: calc(100vh - 9rem);
    scroll-snap-align: start;
  }
}

.post-card {
  overflow: hidden;
  animation: fadeUp 0.45s ease both;
}

.post-card.announcement {
  border-color: rgba(47, 125, 91, 0.2);
  box-shadow: 0 20px 70px rgba(11, 48, 38, 0.1);
}

.feed-create-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
  animation: fadeUp 0.35s ease both;
}

.feed-new-post {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.8rem;
  padding: 0.75rem 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(11, 48, 38, 0.2);
  border-radius: 0.78rem;
  background: linear-gradient(135deg, #0b3026, #123f34);
  color: #ffffff;
  box-shadow: 0 16px 38px rgba(11, 48, 38, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feed-new-post:hover,
.feed-new-post:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(11, 48, 38, 0.24);
}

.feed-new-post:active {
  transform: scale(0.985);
}

.feed-new-post-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.68rem;
  background: rgba(255, 255, 255, 0.1);
}

.feed-new-post-icon svg,
.feed-new-notice svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-new-post-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.feed-new-post-copy strong {
  font-size: 1rem;
}

.feed-new-post-copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-new-post-arrow {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #ffffff;
  color: #0b3026;
  font-size: 1.15rem;
  font-weight: 900;
}

.feed-new-notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 9.5rem;
  min-height: 4.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(47, 125, 91, 0.25);
  border-radius: 0.78rem;
  background: #edf6f1;
  color: #123b2c;
  transition: transform 0.18s ease, background 0.18s ease;
}

.feed-new-notice > span {
  display: grid;
  place-items: center;
}

.feed-new-notice:hover,
.feed-new-notice:focus-visible {
  background: #dff0e7;
  transform: translateY(-2px);
}

@media (max-width: 560px) {
  .feed-create-actions {
    grid-template-columns: 1fr;
  }

  .feed-new-notice {
    min-height: 3.5rem;
  }
}

.notice-card {
  overflow: hidden;
  padding: clamp(1.2rem, 4vw, 2rem);
  border: 1px solid #234c3d;
  border-left: 0.38rem solid #2f7d5b;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 20px 48px rgba(16, 37, 29, 0.13);
  animation: fadeUp 0.45s ease both;
}

.notice-card-top,
.notice-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.notice-card-top { justify-content: space-between; }
.notice-card-top time { color: var(--muted); font-size: 0.78rem; }
.notice-label { color: #286c50; font-size: 0.72rem; font-weight: 950; }
.notice-card h2 { margin: 0.8rem 0 0.55rem; color: #10251d; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.15; overflow-wrap: anywhere; }
.notice-description { margin: 0; color: #344b42; line-height: 1.6; overflow-wrap: anywhere; }
.notice-author { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem; font-size: 0.83rem; font-weight: 850; }
.notice-card-actions { margin-top: 1.2rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.notice-card-actions form { margin: 0; }
.notice-vote, .notice-chat-link, .notice-delete { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.7rem; padding: 0 0.85rem; border: 1px solid #d7e3dc; border-radius: 0.5rem; background: #f8faf9; color: #10251d; font-weight: 850; cursor: pointer; }
.notice-vote span { font-size: 1.25rem; line-height: 1; }
.notice-vote.is-selected { border-color: #2f7d5b; background: #e6f3ec; color: #286c50; }
.notice-chat-link { border-color: #123b2c; background: #123b2c; color: #fff; }
.notice-delete { color: #bd3434; }
.notice-voters-panel { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin-top:.7rem; }
.notice-voters-panel details { min-width:0; border:1px solid var(--line); border-radius:.55rem; background:#f8faf9; }
.notice-voters-panel summary { min-height:2.8rem; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.5rem; padding:.55rem .7rem; list-style:none; cursor:pointer; }
.notice-voters-panel summary::-webkit-details-marker { display:none; }
.notice-voters-panel summary strong { min-width:0; font-size:.78rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notice-voters-panel summary > b { min-width:1.65rem; height:1.65rem; display:grid; place-items:center; border-radius:999px; background:#e8f0eb; font-size:.72rem; }
.notice-voter-sign { width:1.75rem; height:1.75rem; display:grid; place-items:center; border-radius:50%; color:#fff; font-size:1.15rem; font-weight:950; line-height:1; }
.notice-voter-sign.plus { background:#17613b; }
.notice-voter-sign.minus { background:#9f2d2d; }
.notice-voter-list { display:grid; gap:.35rem; max-height:13rem; overflow-y:auto; border-top:1px solid var(--line); padding:.55rem; }
.notice-voter-list a { display:flex; align-items:center; gap:.5rem; min-width:0; border-radius:.45rem; padding:.35rem; background:#fff; font-size:.78rem; font-weight:800; }
.notice-voter-list a span:last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notice-voter-list p { margin:.25rem; color:var(--muted); font-size:.75rem; }
@media(max-width:520px){.notice-voters-panel{grid-template-columns:1fr}}
.notice-composer { max-width: 42rem; margin: 1rem auto; padding: clamp(1.1rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: 0.75rem; background: #fff; box-shadow: 0 16px 42px rgba(16, 37, 29, 0.08); }
.notice-composer h1 { margin: 1rem 0 1.4rem; font-size: 1.8rem; }
.notice-back { color: #286c50; font-weight: 800; }
.notice-chat-shell { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100dvh - 12rem); min-height: 22rem; max-width: 48rem; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 0.75rem; background: #fff; box-shadow: 0 16px 42px rgba(16, 37, 29, 0.08); }
.notice-chat-head { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); background: #f8faf9; }
.notice-chat-head > a { display: grid; place-items: center; flex: 0 0 2.4rem; width: 2.4rem; height: 2.4rem; border-radius: 0.5rem; background: #e8f0eb; font-size: 1.3rem; }
.notice-chat-head div { min-width: 0; }
.notice-chat-head small { color: #286c50; font-size: 0.65rem; font-weight: 950; }
.notice-chat-head h1 { margin: 0.08rem 0 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-chat-messages { display: flex; flex-direction: column; gap: 0.65rem; min-height: 0; padding: 1rem; overflow-y: auto; overscroll-behavior: contain; }
.notice-chat-empty { align-self: center; margin: auto 0; color: var(--muted); font-size: 0.88rem; text-align: center; }
.notice-chat-bubble { align-self: flex-start; max-width: min(86%, 35rem); padding: 0.7rem 0.9rem; border-radius: 0.75rem; background: #edf3ef; overflow-wrap: anywhere; }
.notice-chat-bubble.mine { align-self: flex-end; background: #123b2c; color: #fff; }
.notice-chat-bubble strong { font-size: 0.75rem; }
.notice-chat-bubble p { margin: 0.22rem 0; line-height: 1.45; }
.notice-chat-bubble small { font-size: 0.67rem; opacity: 0.7; }
.notice-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; padding: 0.8rem; border-top: 1px solid var(--line); }
.notice-chat-form input { min-width: 0; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; font-size: 1rem; }
.notice-chat-form button { border: 0; border-radius: 0.5rem; padding: 0 1rem; background: #123b2c; color: #fff; font-weight: 850; }
.notice-chat-form button:disabled { opacity: 0.5; }
.notice-chat-error { position: absolute; left: 1rem; bottom: 4.4rem; right: 1rem; margin: 0; padding: 0.6rem; border-radius: 0.4rem; background: #fff0f0; color: #a32b2b; font-size: 0.78rem; }
.notice-chat-new { position: absolute; left: 50%; bottom: 5rem; transform: translateX(-50%); border: 0; border-radius: 999px; padding: 0.5rem 0.8rem; background: #123b2c; color: #fff; font-weight: 850; }

.stats-dashboard { display: grid; gap: 1.7rem; }
.stats-heading { padding: 0.6rem 0 0.3rem; }
.stats-heading a { color: #286c50; font-weight: 850; }
.stats-heading h1 { margin: 0.7rem 0 0.15rem; color: #10251d; font-size: 2rem; }
.stats-heading p, .stats-note { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.stats-heading p { margin: 0; }
.stats-section { padding-top: 1.2rem; border-top: 1px solid var(--line); }
.stats-section h2 { margin: 0 0 0.85rem; color: #10251d; font-size: 1.15rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.65rem; }
.stats-tile { display: flex; flex-direction: column; min-width: 0; min-height: 6rem; padding: 0.85rem; border: 1px solid #dce8e1; border-radius: 0.5rem; background: #fff; }
.stats-tile span { color: #5e746a; font-size: 0.77rem; font-weight: 750; }
.stats-tile strong { margin-top: 0.4rem; color: #10251d; font-size: 1.5rem; line-height: 1.1; overflow-wrap: anywhere; }
.stats-tile small { margin-top: 0.3rem; color: var(--muted); font-size: 0.68rem; }
.stats-note { margin: 0.85rem 0 0; }
.stats-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.6rem; height: 12rem; margin-top: 1rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; }
.stats-bar-column { display: grid; grid-template-rows: 1rem minmax(0, 1fr) 1rem; gap: 0.3rem; min-width: 0; text-align: center; }
.stats-bar-column strong { font-size: 0.7rem; }
.stats-bar-column > div { display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #d5e5dc; }
.stats-bar-column > div span { width: min(100%, 2.8rem); border-radius: 0.3rem 0.3rem 0 0; background: #2f7d5b; }
.stats-bar-column small { color: var(--muted); font-size: 0.65rem; }
.stats-columns { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 1.2rem; }
.stats-list { display: grid; gap: 0.4rem; }
.stats-list > div { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; min-width: 0; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); background: #fff; font-size: 0.82rem; }
.stats-list > div span { min-width: 0; overflow-wrap: anywhere; }
.stats-list > div strong { flex: none; color: #10251d; }
.stats-list > div small { display: block; margin-top: 0.16rem; color: var(--muted); font-size: 0.7rem; }
.stats-list time { flex: none; color: var(--muted); font-size: 0.74rem; }
.stats-list > .stats-visit-row { display: grid; grid-template-columns: minmax(8rem, 0.8fr) minmax(18rem, 1.8fr) auto; align-items: center; gap: 0.8rem; padding-block: 0.8rem; }
.stats-visit-person { min-width: 0; }
.stats-visit-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.stats-list .stats-visit-tag { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; margin: 0; padding: 0.34rem 0.5rem; border: 1px solid #dce8e1; border-radius: 0.4rem; background: #f5f9f7; color: #2d463b; line-height: 1.2; }
.stats-visit-tag b { color: #6b8076; font-size: 0.58rem; letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 760px) {
  .stats-list > .stats-visit-row { grid-template-columns: minmax(0, 1fr) auto; }
  .stats-visit-tags { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .stats-columns { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-list time { font-size: 0.66rem; }
  .stats-list .stats-visit-tag { flex: 1 1 calc(50% - 0.35rem); }
  .stats-list .stats-visit-tag:first-child { flex-basis: 100%; }
}

.photo-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.post-photo {
  display: block;
  width: 100%;
  max-height: 42rem;
  object-fit: cover;
  background: var(--soft);
}

.post-video-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: min(62vh, 34rem);
  overflow: hidden;
  background: #050505;
}

.post-video {
  display: block;
  width: 100%;
  max-height: min(72vh, 42rem);
  object-fit: contain;
  background: #050505;
}

.video-download {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0.5rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0 0.78rem;
  border-radius: 999px;
  background: rgba(255, 74, 92, 0.13);
  color: #d8263e;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(216, 38, 62, 0.12);
}

.post-meta,
.post-body {
  padding: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
}

.person-link,
.chat-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-mini,
.avatar-big {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
}

.avatar-wrap { position: relative; display:inline-flex; }
.online-dot { position:absolute; right:.08rem; bottom:.08rem; width:.82rem; height:.82rem; border-radius:50%; background:#22c55e; border:2px solid #fff; }
.chat-person .online-dot,
.person-link .online-dot {
  width: 0.95rem;
  height: 0.95rem;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
.online-text {
  display: block;
  color: #16a34a;
  font-weight: 950;
  margin-top: 0.15rem;
}
.last-seen { color:var(--muted); font-weight:800; }

.avatar-mini {
  width: 2.9rem;
  height: 2.9rem;
}

.avatar-big {
  width: 7.4rem;
  height: 7.4rem;
}

.avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--green), var(--green-2));
  color: #ffffff;
  font-weight: 900;
}

.name {
  color: var(--green);
  font-weight: 900;
}

.time {
  color: var(--muted);
  font-size: 0.88rem;
}

.caption {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0 1rem 1rem;
}

.icon-btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 1rem;
  background: #ffffff;
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.button.primary,
.icon-btn.is-liked {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.button.danger {
  border-color: #d92d20;
  background: #d92d20;
  color: #ffffff;
}

.button.password-cta,
.password-submit,
.password-reset-btn {
  border-color: transparent;
  background: linear-gradient(135deg, #10251d, #2f7d5b);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(47, 125, 91, 0.24);
}

.button.password-cta {
  position: relative;
  overflow: hidden;
}

.button.password-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-100%);
  animation: shine 2.8s ease infinite;
}

.project-new-button,
.project-new-wide {
  min-height: 3.25rem;
  border-radius: 0.75rem;
  font-size: 1rem;
}

.project-new-wide {
  width: 100%;
  margin-bottom: 1rem;
}

.login-submit {
  width: 100%;
  min-height: 3.35rem;
  margin-top: 0.25rem;
  box-shadow: 0 16px 34px rgba(11, 48, 38, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.login-submit:active {
  transform: scale(0.98);
}

.form {
  display: grid;
  gap: 0.85rem;
}

.form label {
  display: grid;
  gap: 0.35rem;
  color: var(--green);
  font-weight: 900;
}

.form input,
.form textarea,
.form select,
.search {
  width: 100%;
  border: 1px solid rgba(11, 48, 38, 0.16);
  border-radius: 0.65rem;
  padding: 0.9rem 1rem;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.form textarea {
  min-height: 8rem;
  resize: vertical;
}

.form input:focus,
.form textarea:focus,
.form select:focus,
.search:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 255, 142, 0.13);
}

.form input[type="file"] {
  min-height: 4.5rem;
  padding: 1rem;
  border: 1px dashed rgba(18, 59, 44, 0.34);
  background: linear-gradient(180deg, #ffffff, #f5f8f6);
  cursor: pointer;
}

.form input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 0.55rem;
  background: var(--green);
  color: #ffffff;
  padding: 0.7rem 0.9rem;
  margin-right: 0.75rem;
  font-weight: 900;
  cursor: pointer;
}

.upload-progress {
  display: none;
  min-height: 2.5rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--green);
  font-weight: 900;
}

.upload-progress::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 3px solid rgba(18, 59, 44, 0.18);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}

.upload-progress.is-active {
  display: inline-flex;
}

.sponsor-admin-shell {
  display: grid;
  gap: 1rem;
}

.sponsor-admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: 1rem;
  background: #10251d;
  color: #ffffff;
  box-shadow: 0 22px 60px rgba(16, 37, 29, 0.18);
}

.sponsor-admin-head span,
.sponsor-admin-list-head span {
  color: #9fd8be;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sponsor-admin-head h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 0.95;
}

.sponsor-admin-head p {
  max-width: 42rem;
  margin: 0.8rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.sponsor-admin-head .button {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.2);
  background: #ffffff;
  color: #10251d;
}

.sponsor-admin-form {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.sponsor-admin-main-fields,
.sponsor-admin-links,
.sponsor-admin-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.sponsor-admin-logo-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
}

.sponsor-admin-current-logo {
  width: 9rem;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.sponsor-admin-current-logo img {
  width: 100%;
  height: 5rem;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.65rem;
  background: #ffffff;
}

.sponsor-visible-toggle {
  display: flex !important;
  align-items: center;
  gap: 0.7rem !important;
  min-height: 3.25rem;
  align-self: end;
  border: 1px solid rgba(11, 48, 38, 0.16);
  border-radius: 0.65rem;
  padding: 0 1rem;
  background: #ffffff;
}

.sponsor-visible-toggle input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  accent-color: var(--green);
}

.sponsor-save-button {
  min-height: 3.35rem;
  border-radius: 0.7rem;
}

.sponsor-admin-error {
  border-color: #f1b7b2;
  background: #fff1f0;
  color: #a32b2b;
}

.sponsor-admin-list {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 56px rgba(11, 48, 38, 0.08);
}

.sponsor-admin-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sponsor-admin-list-head h2 {
  margin: 0.25rem 0 0;
  color: #10251d;
}

.sponsor-admin-list-head a {
  color: #286c50;
  font-weight: 900;
}

.sponsor-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.sponsor-admin-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.8rem;
  background: #ffffff;
}

.sponsor-admin-item.is-hidden {
  opacity: 0.62;
}

.sponsor-admin-item-logo {
  display: grid;
  place-items: center;
  height: 6.5rem;
  border-radius: 0.7rem;
  padding: 0.65rem;
  background: #f3f6f8;
}

.sponsor-admin-item-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sponsor-admin-item-copy {
  min-width: 0;
}

.sponsor-admin-item-copy > span {
  color: #5e746a;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sponsor-admin-item-copy h3 {
  margin: 0.25rem 0;
  color: #10251d;
  overflow-wrap: anywhere;
}

.sponsor-admin-item-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sponsor-admin-item-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.sponsor-admin-item-actions form,
.sponsor-admin-item-actions .button {
  width: 100%;
}

.gallery-file-count {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f7f8f8;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.gallery-file-count.is-ready {
  border-color: rgba(18, 59, 44, 0.32);
  background: rgba(18, 59, 44, 0.07);
  color: var(--green);
}

.gallery-file-count.is-error {
  border-color: rgba(188, 35, 35, 0.35);
  background: rgba(188, 35, 35, 0.07);
  color: #a61d1d;
}

.profile-hero {
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 4vw, 2rem);
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.menu-hero {
  margin-bottom: 1rem;
}

.menu-hero .profile-row,
.profile-hero .profile-row {
  align-items: center;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

details.card {
  padding: 1rem;
  margin-top: 1rem;
}

details.card > summary {
  cursor: pointer;
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 950;
  list-style: none;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-row h1 {
  margin: 0;
  color: var(--green);
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.95;
}

.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--green);
  font-weight: 850;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.grid img,
.grid video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  object-fit: cover;
  background: #050505;
}

.grid form img {
  margin-bottom: 0.45rem;
}

.gallery-admin-section {
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-top: 1rem;
}

.gallery-admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-admin-heading h2 {
  margin: 0.25rem 0 0;
}

.section-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-admin-heading > strong {
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-admin-item {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.65rem;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(11, 48, 38, 0.08);
}

.gallery-admin-preview {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #e9eeeb;
}

.gallery-admin-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-admin-preview span {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
}

.gallery-admin-item label {
  display: grid;
  gap: 0.35rem;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
}

.gallery-admin-item textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.75rem;
  color: var(--text);
  background: var(--soft);
  font: inherit;
  line-height: 1.45;
}

.gallery-admin-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.gallery-order-status {
  width: fit-content;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  transition: color 0.2s ease, background 0.2s ease;
}

.gallery-order-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.gallery-order-toggle {
  min-height: 2.8rem;
}

.gallery-order-status.is-saving {
  color: #73530b;
  background: #fff7dc;
}

.gallery-order-status.is-saved {
  color: var(--green);
  background: rgba(18, 59, 44, 0.08);
}

.gallery-order-status.is-error {
  color: #a61d1d;
  background: rgba(188, 35, 35, 0.08);
}

.gallery-admin-item {
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-admin-item.is-dragging {
  z-index: 4;
  opacity: 0.58;
  transform: scale(0.98);
  box-shadow: 0 22px 50px rgba(11, 48, 38, 0.2);
}

.gallery-drag-handle {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 0.72rem;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.gallery-drag-handle:active {
  cursor: grabbing;
}

.gallery-drag-handle i,
.gallery-drag-handle i::before,
.gallery-drag-handle i::after {
  width: 0.28rem;
  height: 0.28rem;
  display: block;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0.55rem 0 #ffffff;
}

.gallery-drag-handle i {
  position: relative;
  transform: translateX(-0.275rem);
}

.gallery-drag-handle i::before,
.gallery-drag-handle i::after {
  position: absolute;
  left: 0;
  content: "";
}

.gallery-drag-handle i::before {
  top: -0.55rem;
}

.gallery-drag-handle i::after {
  top: 0.55rem;
}

.gallery-position,
.gallery-quick-actions {
  display: none;
}

.gallery-admin-grid.is-sorting {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  scroll-margin-top: 5rem;
}

.gallery-admin-grid.is-sorting .gallery-admin-item {
  gap: 0;
  padding: 0.35rem;
  border-radius: 0.8rem;
}

.gallery-admin-grid.is-sorting .gallery-admin-item > label,
.gallery-admin-grid.is-sorting .gallery-admin-actions,
.gallery-admin-grid.is-sorting .gallery-admin-preview > span {
  display: none;
}

.gallery-admin-grid.is-sorting .gallery-admin-preview,
.gallery-admin-grid.is-sorting .gallery-admin-preview img {
  border-radius: 0.58rem;
}

.gallery-admin-grid.is-sorting .gallery-admin-preview img {
  aspect-ratio: 1 / 1;
}

.gallery-admin-grid.is-sorting .gallery-drag-handle {
  width: 2.35rem;
  height: 2.35rem;
  top: 0.4rem;
  right: 0.4rem;
}

.gallery-admin-grid.is-sorting .gallery-position {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  min-width: 2rem;
  min-height: 2rem;
  display: grid;
  place-items: center;
  padding: 0.3rem 0.45rem;
  border-radius: 0.55rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.78);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.gallery-admin-grid.is-sorting .gallery-quick-actions {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  left: 0.35rem;
  display: grid;
  grid-template-columns: 1fr 2rem 2rem;
  gap: 0.25rem;
}

.gallery-quick-actions button {
  min-width: 0;
  min-height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 0.45rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.78);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.gallery-quick-actions button:active {
  transform: scale(0.94);
}

.project-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.project-image-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(11, 48, 38, 0.08);
}

.project-image-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.project-image-item form {
  padding: 0.75rem;
}

.project-image-item .button {
  width: 100%;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  height: calc(100dvh - 12.9rem);
  min-height: 32rem;
  min-width: 0;
  max-width: 100%;
}

.people-panel {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

.list {
  display: grid;
  gap: 0.65rem;
}

.chat-person {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #ffffff;
}

.watch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #ffffff;
}

.watch-row > span {
  flex: 1;
  min-width: 0;
}

.mini-danger {
  min-height: 2.15rem;
  border: 0;
  border-radius: 999px;
  padding: 0 0.75rem;
  background: #d92d20;
  color: #ffffff;
  font-weight: 950;
  cursor: pointer;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.watch-post {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #ffffff;
}

.watch-post img,
.watch-post video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #050505;
}

.watch-post div {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
}

.watch-post p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.chat-person.is-active {
  background: rgba(0, 255, 142, 0.12);
  border-color: rgba(11, 48, 38, 0.32);
}

.chat-person label {
  display: grid;
  gap: 0.3rem;
  color: var(--green);
  font-weight: 850;
}

.chat-person input,
.chat-person select {
  border: 1px solid rgba(11, 48, 38, 0.16);
  border-radius: 0.85rem;
  padding: 0.68rem 0.75rem;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.chat-panel.is-active {
  animation: fadeUp 0.3s ease both;
}

.chat-head,
.chat-form {
  padding: 1rem;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.6rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.chat-head .person-link {
  min-width: 0;
  flex: 1;
}

.chat-head .person-link > span:last-child {
  min-width: 0;
}

.chat-head .person-link strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-back-button {
  display: grid;
  place-items: center;
  flex: 0 0 2.65rem;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  color: var(--green);
}

.chat-back-button:hover,
.chat-back-button:focus-visible {
  background: #edf3ef;
}

.chat-back-button svg {
  width: 1.55rem;
  height: 1.55rem;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.bubble {
  width: fit-content;
  max-width: min(82%, 36rem);
  min-width: 0;
  padding: 0.68rem 0.82rem;
  border-radius: 1.05rem 1.05rem 1.05rem 0.3rem;
  background: #edf1ef;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.bubble > div:first-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble.me {
  align-self: flex-end;
  border-radius: 1.05rem 1.05rem 0.3rem 1.05rem;
  background: var(--green);
  color: #ffffff;
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.bubble small {
  display: block;
  opacity: 0.66;
}

.message-delete-button {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: currentColor;
  opacity: 0.62;
  cursor: pointer;
}

.message-delete-button:hover,
.message-delete-button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

.message-delete-button svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.6rem;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.chat-form textarea {
  min-width: 0;
  max-height: 7rem;
  resize: none;
  overflow-y: auto;
  border-radius: 1.35rem;
  padding: 0.72rem 0.95rem;
  line-height: 1.35;
}

.chat-send-button {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
}

.chat-send-button svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(22px);
}

.bottom-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr));
  gap: 0.45rem;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 0.45rem;
}

.tab {
  display: grid;
  place-items: center;
  gap: 0.15rem;
  min-height: 3.75rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tab svg {
  width: 1.3rem;
  height: 1.3rem;
  stroke-width: 2.25;
}

.notification-dot {
  display: inline-block;
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #e33838;
  box-shadow: 0 0 0 2px #fff, 0 2px 7px rgba(227, 56, 56, 0.35);
  vertical-align: middle;
}

.notification-dot[hidden] {
  display: none;
}

.tab-dot {
  position: absolute;
  top: 0.52rem;
  left: calc(50% + 0.7rem);
}

.inline-dot {
  margin-left: 0.35rem;
}

.menu-item .notification-dot {
  background: #e33838;
}

.tab.is-active {
  background: #e6f1eb;
  border-color: rgba(18, 59, 44, 0.16);
  color: var(--green);
  transform: translateY(-2px);
}

.gmail-shell {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  min-height: calc(100vh - 13rem);
  overflow: hidden;
  border: 1px solid #dfe3e7;
  border-radius: 1rem;
  background: #f5f8f6;
  box-shadow: 0 18px 55px rgba(32, 33, 36, 0.1);
}

.gmail-sidebar {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.7rem;
  background: #f5f8f6;
}

.gmail-compose-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  min-height: 3.5rem;
  margin: 0 0.35rem 1rem;
  padding: 0 1.25rem;
  border-radius: 1rem;
  background: #dff0e7;
  color: #001d35;
  font-weight: 850;
  box-shadow: 0 2px 5px rgba(60, 64, 67, 0.12);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.gmail-compose-button:hover {
  box-shadow: 0 5px 13px rgba(60, 64, 67, 0.22);
  transform: translateY(-1px);
}

.gmail-compose-button svg,
.gmail-folders svg,
.gmail-list-head svg,
.gmail-reader-tools svg,
.gmail-reply-button svg,
.gmail-attach svg,
.gmail-attachment-note svg {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  stroke-width: 2;
}

.gmail-folders {
  display: grid;
  gap: 0.25rem;
}

.gmail-folders a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 0 999px 999px 0;
  color: #444746;
  font-weight: 750;
}

.gmail-folders a.is-active {
  background: #dceee4;
  color: #123b2c;
  font-weight: 950;
}

.gmail-account {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: auto 0.35rem 0;
  padding: 0.85rem;
  border-top: 1px solid #dde2e7;
}

.gmail-account > span:last-child {
  display: grid;
  min-width: 0;
}

.gmail-account small {
  overflow: hidden;
  color: #5f6368;
  text-overflow: ellipsis;
}

.gmail-account-avatar,
.gmail-sender-avatar,
.gmail-row-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2f7d5b;
  color: #ffffff;
  font-weight: 850;
}

.gmail-account-avatar,
.gmail-sender-avatar {
  width: 2.5rem;
  height: 2.5rem;
}

.gmail-content {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 1rem 0 0 1rem;
  background: #ffffff;
}

.gmail-list-head,
.gmail-reader-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid #e7e9ec;
}

.gmail-list-head h1 {
  margin: 0;
  color: #202124;
  font-size: 1.15rem;
}

.gmail-list-head span,
.gmail-reader-tools span {
  color: #5f6368;
  font-size: 0.8rem;
}

.gmail-list-head a,
.gmail-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  color: #444746;
}

.gmail-list-head a:hover,
.gmail-back:hover {
  background: #f0f2f4;
}

.gmail-message-list {
  max-height: calc(100vh - 17.5rem);
  overflow-y: auto;
}

.gmail-message-row {
  display: grid;
  grid-template-columns: 2.1rem minmax(8rem, 0.6fr) minmax(10rem, 1.4fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.65rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #ebecef;
  background: #f8faf9;
  color: #3c4043;
  box-shadow: inset 0 -1px 0 rgba(100, 121, 143, 0.08);
}

.gmail-message-row:hover {
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.22);
}

.gmail-message-row.is-unread {
  background: #ffffff;
  color: #202124;
}

.gmail-message-row.is-unread strong,
.gmail-message-row.is-unread .gmail-row-subject {
  font-weight: 950;
}

.gmail-row-avatar {
  width: 2rem;
  height: 2rem;
  background: #5f6368;
  font-size: 0.78rem;
}

.gmail-message-row strong,
.gmail-row-subject {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gmail-message-row time {
  color: #5f6368;
  font-size: 0.76rem;
  white-space: nowrap;
}

.gmail-empty {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  min-height: 24rem;
  padding: 2rem;
  color: #5f6368;
  text-align: center;
}

.gmail-empty svg {
  width: 3rem;
  height: 3rem;
}

.gmail-reader {
  min-height: 34rem;
  animation: pageIn 0.25s ease both;
}

.gmail-reader-tools {
  justify-content: flex-start;
  gap: 0.75rem;
}

.gmail-reader-head,
.gmail-message-body {
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}

.gmail-reader-head h1 {
  margin: 0 0 1.4rem;
  color: #202124;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  letter-spacing: 0;
}

.gmail-sender-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
}

.gmail-sender-row > div {
  display: grid;
  min-width: 0;
}

.gmail-sender-row strong,
.gmail-sender-row small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gmail-sender-row small,
.gmail-sender-row time {
  color: #5f6368;
  font-size: 0.78rem;
}

.gmail-message-body {
  min-height: 13rem;
  color: #202124;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.gmail-reply-button,
.gmail-attachment-note {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  margin: 0 0 1.5rem clamp(1rem, 4vw, 2.5rem);
  padding: 0 1rem;
  border: 1px solid #c7cacf;
  border-radius: 999px;
  color: #3c4043;
  font-weight: 850;
}

.gmail-attachment-note {
  border-radius: 0.6rem;
  background: #f8faf9;
  color: #5f6368;
}

.gmail-compose-window {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: min(38rem, calc(100% - 2rem));
  overflow: hidden;
  border-radius: 0.7rem;
  background: #ffffff;
  box-shadow: 0 8px 28px rgba(60, 64, 67, 0.38);
  animation: fadeUp 0.25s ease both;
}

.gmail-compose-window > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.65rem;
  padding: 0 0.9rem;
  background: #f3f7f4;
  color: #123b2c;
  font-size: 0.85rem;
}

.gmail-compose-window > header a {
  font-size: 1.5rem;
  line-height: 1;
}

.gmail-compose-form {
  display: grid;
}

.gmail-compose-form > label {
  display: grid;
  grid-template-columns: 4rem 1fr;
  align-items: center;
  min-height: 2.7rem;
  padding: 0 0.9rem;
  border-bottom: 1px solid #e7e9ec;
  color: #5f6368;
  font-size: 0.86rem;
}

.gmail-compose-form input,
.gmail-compose-form textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: #202124;
  outline: none;
}

.gmail-compose-form textarea {
  min-height: 19rem;
  padding: 1rem;
  resize: none;
  line-height: 1.55;
}

.gmail-compose-form footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 4rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid #f0f1f3;
}

.gmail-send {
  min-height: 2.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0 1.35rem;
  background: #0b57d0;
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

.gmail-attach {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0 0.6rem;
  border-radius: 0.45rem;
  color: #444746;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.gmail-attach:hover {
  background: #f0f2f4;
}

.gmail-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gmail-toast,
.gmail-error {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: #202124;
  color: #ffffff;
  font-weight: 750;
}

.gmail-error {
  background: #b3261e;
}

.feature-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(47, 125, 91, 0.24);
  border-radius: 0.75rem;
  background: #edf6f1;
}

.feature-toggle-card > span {
  display: grid;
  gap: 0.2rem;
}

.feature-toggle-card strong {
  color: var(--green);
}

.feature-toggle-card small {
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 3.3rem;
  height: 1.9rem;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #aab3bd;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 37, 29, 0.24);
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: #2f7d5b;
}

.switch input:checked + span::after {
  transform: translateX(1.4rem);
}

.feature-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: #e9f8ef;
}

.family-edition-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  overflow: hidden;
  border-radius: 0.75rem;
  background: #10251d;
  color: #ffffff;
  box-shadow: 0 18px 48px rgba(16, 37, 29, 0.18);
  animation: fadeUp 0.35s ease both;
}

.family-edition-hero > div > span {
  display: inline-flex;
  margin-bottom: 0.6rem;
  color: #9fd8be;
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.family-edition-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 6vw, 3.8rem);
  line-height: 1;
}

.family-edition-hero > div > strong {
  display: block;
  margin-top: 0.45rem;
  color: #9fd8be;
  font-size: 1.05rem;
}

.family-edition-hero p {
  max-width: 44rem;
  margin: 0.8rem 0 0;
  color: #d7e8df;
  line-height: 1.55;
}

.family-edition-hero time {
  display: grid;
  place-items: center;
  width: 7rem;
  height: 7rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.family-edition-hero time b {
  align-self: end;
  font-size: 2.3rem;
  line-height: 1;
}

.family-edition-hero time span {
  align-self: start;
  color: #9fd8be;
  font-weight: 850;
}

.family-edition-switcher {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(14rem, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

.family-edition-option {
  display: grid;
  gap: 0.2rem;
  min-height: 5.4rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #ffffff;
  color: var(--green);
}

.family-edition-option > span,
.family-edition-option small {
  color: var(--muted);
  font-size: 0.74rem;
}

.family-edition-option.is-active {
  border-color: #2f7d5b;
  background: #edf6f1;
  box-shadow: inset 0 -0.2rem #2f7d5b;
}

.families-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(16, 37, 29, 0.07);
}

.families-title,
.families-tools,
.family-name-row,
.family-actions {
  display: flex;
  align-items: center;
}

.families-title {
  gap: 0.75rem;
}

.families-title > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.65rem;
  background: var(--green);
  color: #ffffff;
}

.families-title svg,
.family-search svg,
.family-actions svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke-width: 2;
}

.families-title > div {
  display: grid;
}

.families-title strong {
  color: var(--green);
  font-size: 1.05rem;
}

.families-title small {
  color: var(--muted);
}

.families-tools {
  gap: 0.55rem;
}

.family-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(22rem, 42vw);
  min-height: 2.8rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f5f8f6;
  color: var(--muted);
}

.family-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.family-filter-button,
.family-segments button,
.family-add-child,
.family-remove-child {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--green);
  font-weight: 850;
  cursor: pointer;
}

.family-filter-button {
  min-height: 2.8rem;
  border-radius: 0.65rem;
  padding: 0 1rem;
}

.families-filters {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(17rem, 1.5fr) auto;
  align-items: end;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #ffffff;
  animation: fadeUp 0.22s ease both;
}

.families-filters label,
.families-filters > div {
  display: grid;
  gap: 0.4rem;
  color: var(--green);
  font-weight: 850;
}

.families-filters select {
  min-height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0 0.7rem;
  background: #ffffff;
}

.family-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.family-segments button {
  min-height: 2.7rem;
  border-radius: 0.55rem;
}

.family-segments button.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.family-groups {
  display: grid;
  gap: 1rem;
}

.family-archive-notice {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(7, 65, 45, 0.16);
  border-radius: 0.75rem;
  background: #f5f8f6;
  color: var(--green);
}

.family-archive-notice > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.8rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
}

.family-archive-notice svg,
.family-protected-cover svg {
  width: 1.25rem;
  stroke-width: 1.8;
}

.family-archive-notice p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.family-city-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  animation: fadeUp 0.35s ease both;
}

.family-city-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.4rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: #edf6f1;
  color: var(--green);
}

.family-city-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.family-list {
  display: grid;
}

.family-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.family-card:last-child {
  border-bottom: 0;
}

.family-card.is-visited {
  background: #f2fbf6;
  box-shadow: inset 0.25rem 0 #1e9b58;
}

.family-card.is-protected {
  position: relative;
  min-height: 8.7rem;
  overflow: hidden;
  isolation: isolate;
  background: #f8faf9;
}

.family-protected-content {
  filter: blur(0.42rem);
  opacity: 0.46;
  user-select: none;
  pointer-events: none;
}

.family-protected-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.38);
  color: var(--green);
  text-align: center;
  backdrop-filter: blur(0.08rem);
}

.family-protected-cover strong {
  font-size: 0.86rem;
}

.family-name-row {
  gap: 0.75rem;
}

.family-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-weight: 950;
}

.family-name-row h2 {
  margin: 0;
  color: var(--green);
  font-size: 1.08rem;
}

.family-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.family-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
  margin: 0.9rem 0 0;
}

.family-details div {
  display: grid;
  gap: 0.15rem;
}

.family-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.family-details dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.family-details a {
  color: #0b63a7;
}

.family-notes {
  margin: 0.85rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.family-children {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.family-children span {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #f7faf8;
  color: var(--muted);
  font-size: 0.78rem;
}

.family-visit-meta {
  display: block;
  min-height: 1rem;
  margin-top: 0.7rem;
  color: #168047;
  font-weight: 750;
}

.family-actions {
  align-self: start;
  gap: 0.45rem;
}

.family-visit-button,
.family-call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.family-visit-button.is-on {
  border-color: #1e9b58;
  background: #1e9b58;
  color: #ffffff;
}

.family-call-button {
  border-color: #2f7d5b;
  background: #2f7d5b;
  color: #ffffff;
}

.family-edit-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 850;
}

.family-no-results,
.family-empty {
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.family-empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.family-admin-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.family-admin-top h1 {
  margin: 0.3rem 0;
  color: var(--green);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
}

.family-admin-top p {
  margin: 0;
  color: var(--muted);
}

.family-admin-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.family-admin-form-wrap,
.family-admin-list {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(16, 37, 29, 0.07);
}

.family-feature-bar {
  margin-bottom: 1rem;
}

.family-admin-form {
  display: grid;
}

.family-form-section {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.family-form-section > header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.family-form-section > header > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-weight: 950;
}

.family-form-section > header > div {
  display: grid;
}

.family-form-section header strong {
  color: var(--green);
}

.family-form-section header small {
  color: var(--muted);
}

.family-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 0.7rem;
}

.family-form-grid.two {
  grid-template-columns: 0.75fr 1.25fr;
}

.family-admin-form label,
.family-child-row label {
  display: grid;
  gap: 0.35rem;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 850;
}

.family-admin-form input,
.family-admin-form textarea,
.family-admin-form select {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  background: #fbfcfe;
  color: var(--text);
  outline: none;
}

.family-admin-form input:focus,
.family-admin-form textarea:focus,
.family-admin-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 91, 0.12);
}

.family-admin-form textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.family-add-child {
  min-height: 2.5rem;
  margin-left: auto;
  border-radius: 0.55rem;
  padding: 0 0.8rem;
}

.family-child-editor {
  display: grid;
  gap: 0.55rem;
}

.family-child-row {
  display: grid;
  grid-template-columns: 1fr 7rem 9rem 2.6rem;
  align-items: end;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f7faf8;
  animation: fadeUp 0.2s ease both;
}

.family-remove-child {
  width: 2.6rem;
  height: 2.8rem;
  border-radius: 0.55rem;
  color: #b42318;
  font-size: 1.35rem;
}

.family-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
}

.family-admin-list {
  margin-top: 1rem;
  padding: 1rem;
}

.family-admin-list > header {
  margin-bottom: 0.8rem;
}

.family-admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.family-admin-list-head select {
  min-height: 2.7rem;
  max-width: 20rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0 0.7rem;
  background: #ffffff;
  color: var(--green);
  font-weight: 800;
}

.family-admin-list h2 {
  margin: 0;
  color: var(--green);
}

.family-admin-list header span {
  color: var(--muted);
}

.family-admin-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.family-admin-list article > div {
  display: grid;
  min-width: 0;
}

.family-admin-list article small {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.edition-admin-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.edition-admin-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(16, 37, 29, 0.07);
}

.edition-admin-date {
  display: grid;
  place-items: center;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 0.65rem;
  background: var(--green);
  color: #ffffff;
}

.edition-admin-date strong {
  align-self: end;
  font-size: 1.65rem;
  line-height: 1;
}

.edition-admin-date span {
  align-self: start;
  font-size: 0.65rem;
  font-weight: 850;
}

.edition-admin-info {
  display: grid;
  gap: 0.15rem;
}

.edition-admin-info > span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.edition-admin-info h2 {
  margin: 0;
  color: var(--green);
  font-size: 1.15rem;
}

.edition-admin-info small {
  color: var(--muted);
}

.edition-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.menu-list {
  display: grid;
  gap: 0.75rem;
  animation: fadeUp 0.35s ease both;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  min-height: 4.25rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(11, 48, 38, 0.14);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.96));
  box-shadow: 0 14px 38px rgba(11, 48, 38, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.menu-item:active {
  transform: scale(0.985);
}

.menu-item::after {
  content: "›";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(47, 125, 91, 0.12);
  color: var(--green);
  font-size: 1.6rem;
  line-height: 1;
}

.menu-item strong {
  color: var(--green);
}

.menu-item span {
  color: var(--muted);
  line-height: 1.45;
}

.danger-link {
  border-color: rgba(217, 45, 32, 0.24);
  background: linear-gradient(180deg, rgba(255, 247, 247, 0.98), rgba(255, 255, 255, 0.92));
}

.danger-link strong {
  color: #d92d20;
}

.menu-section-title {
  margin-top: 0.8rem;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 950;
  text-transform: uppercase;
}

.account-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.account-menu-grid .menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  min-width: 0;
}

.account-menu-grid .menu-item span {
  grid-column: 1;
  font-size: 0.82rem;
}

.account-menu-grid .menu-item::after {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.password-link {
  border-color: rgba(47, 125, 91, 0.3);
  background: linear-gradient(145deg, #edf6f1, #ffffff);
}

.admin-title {
  margin-top: 1.25rem;
}

.admin-menu-groups {
  display: grid;
  gap: 0.7rem;
}

.admin-menu-group {
  overflow: hidden;
  border: 1px solid rgba(11, 48, 38, 0.14);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 38px rgba(11, 48, 38, 0.07);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-menu-group[open] {
  border-color: rgba(47, 125, 91, 0.28);
  box-shadow: 0 18px 44px rgba(11, 48, 38, 0.1);
}

.admin-menu-group summary {
  display: grid;
  grid-template-columns: 2.65rem minmax(0, 1fr) 1.8rem;
  align-items: center;
  gap: 0.8rem;
  min-height: 5rem;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.admin-menu-group summary::-webkit-details-marker {
  display: none;
}

.admin-group-icon {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 0.7rem;
  background: #0b3026;
  color: #ffffff;
}

.admin-group-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-group-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.admin-group-copy strong {
  color: var(--green);
  font-size: 1rem;
}

.admin-group-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-group-chevron {
  width: 0.72rem;
  height: 0.72rem;
  justify-self: center;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.22s ease;
}

.admin-menu-group[open] .admin-group-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.admin-group-content {
  display: grid;
  gap: 0.55rem;
  padding: 0 0.7rem 0.7rem;
  border-top: 1px solid rgba(11, 48, 38, 0.08);
  animation: adminGroupReveal 0.24s ease both;
}

.admin-group-content .menu-item,
.admin-group-content .feature-toggle-card {
  min-height: 3.85rem;
  margin-top: 0.55rem;
  border-radius: 0.65rem;
  box-shadow: none;
}

.admin-group-content .menu-item + .menu-item,
.admin-group-content .feature-toggle-card + .menu-item {
  margin-top: 0;
}

@keyframes adminGroupReveal {
  from { opacity: 0; transform: translateY(-0.35rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .account-menu-grid {
    grid-template-columns: 1fr;
  }

  .admin-menu-group summary {
    min-height: 4.65rem;
    padding: 0.72rem 0.8rem;
  }
}

.badge {
  position: absolute;
  top: 0.32rem;
  right: 0.85rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  font-size: 0.68rem;
  line-height: 1.15rem;
}

.comments-strip {
  display: grid;
  gap: 0.7rem;
  padding: 0 1rem 1rem;
}

.mini-comment {
  display: flex;
  align-items: start;
  gap: 0.55rem;
}

.mini-comment p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.tiny {
  width: 1.8rem;
  height: 1.8rem;
  font-size: 0.72rem;
}

.comment-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.comment-inline input {
  border: 1px solid rgba(11, 48, 38, 0.16);
  border-radius: 999px;
  padding: 0.72rem 0.9rem;
  outline: none;
}

.comment-inline button {
  border: 0;
  border-radius: 999px;
  padding: 0 0.95rem;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.92);
  overflow: hidden;
  touch-action: none;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 2rem);
  max-width: calc(100dvw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  object-fit: contain;
  border-radius: 0.4rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  min-width: 3rem;
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 20% 8%, rgba(47, 125, 91, 0.16), transparent 24rem),
    linear-gradient(180deg, #f7faf8, #edf6f1);
}

.login-card {
  width: min(28rem, 100%);
  padding: clamp(1.4rem, 5vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(18, 59, 44, 0.14);
  animation: fadeUp 0.65s ease both;
}

.login-card img {
  display: block;
  width: 5.8rem;
  margin: 0 auto 1rem;
}

.login-card h1 {
  margin: 0 0 1rem;
  color: var(--green);
  text-align: center;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 0.95;
}

.notice {
  color: var(--muted);
  line-height: 1.6;
}

.error {
  color: #9f1d1d;
}

.success {
  color: var(--green);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shine {
  60%,
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 760px) {
  .top-inner,
  .app-main {
    width: min(100% - 1rem, 980px);
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .profile-row {
    align-items: start;
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .profile-actions,
  .admin-actions,
  .grid,
  .gallery-admin-grid,
  .project-image-grid,
  .watch-grid {
    grid-template-columns: 1fr;
  }

  .sponsor-admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .sponsor-admin-main-fields,
  .sponsor-admin-links,
  .sponsor-admin-options,
  .sponsor-admin-grid,
  .sponsor-admin-logo-field {
    grid-template-columns: 1fr;
  }

  .sponsor-admin-current-logo {
    width: 100%;
  }

  .sponsor-admin-item {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .gallery-admin-grid.is-sorting {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .watch-row {
    align-items: stretch;
    flex-direction: column;
  }

  .families-toolbar,
  .family-admin-top {
    align-items: stretch;
    flex-direction: column;
  }

  .family-edition-hero {
    grid-template-columns: 1fr;
  }

  .family-edition-hero time {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 3.3rem;
    border-radius: 0.6rem;
  }

  .family-edition-hero time b,
  .family-edition-hero time span {
    align-self: center;
  }

  .family-edition-hero time b {
    font-size: 1.35rem;
  }

  .family-admin-top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .families-tools {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .family-search {
    min-width: 0;
  }

  .families-filters {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .family-city-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .family-card {
    grid-template-columns: 1fr;
  }

  .family-actions {
    align-self: auto;
  }

  .family-visit-button,
  .family-call-button {
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
  }

  .family-edit-button {
    justify-content: center;
    flex: 1;
    min-height: 3rem;
  }

  .family-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .family-form-grid,
  .family-form-grid.two,
  .family-child-row {
    grid-template-columns: 1fr;
  }

  .family-form-section > header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .family-add-child {
    width: 100%;
    margin: 0.35rem 0 0;
  }

  .family-remove-child {
    width: 100%;
  }

  .family-admin-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .family-admin-list article > .button,
  .family-admin-list article > form {
    grid-column: span 1;
  }

  .family-admin-list article > form .button {
    width: 100%;
  }

  .family-admin-list-head,
  .edition-admin-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .family-admin-list-head {
    display: grid;
  }

  .family-admin-list-head select {
    width: 100%;
    max-width: none;
  }

  .edition-admin-date {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    height: 3rem;
  }

  .edition-admin-date strong,
  .edition-admin-date span {
    align-self: center;
  }

  .edition-admin-date strong {
    font-size: 1.25rem;
  }

  .edition-admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .edition-admin-actions form,
  .edition-admin-actions form .button {
    width: 100%;
  }

  .messages-layout {
    display: block;
    height: auto;
    min-height: 0;
  }

  .gmail-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 9.5rem);
    border-radius: 0.8rem;
  }

  .gmail-sidebar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem;
  }

  .gmail-compose-button {
    width: 3rem;
    min-height: 3rem;
    justify-content: center;
    margin: 0;
    padding: 0;
    border-radius: 0.75rem;
  }

  .gmail-compose-button span,
  .gmail-account {
    display: none;
  }

  .gmail-folders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .gmail-folders a {
    justify-content: center;
    min-height: 3rem;
    padding: 0 0.7rem;
    border-radius: 0.75rem;
  }

  .gmail-content {
    min-height: calc(100vh - 13.1rem);
    border-radius: 0;
  }

  .gmail-message-list {
    max-height: calc(100vh - 17.6rem);
  }

  .gmail-message-row {
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0.15rem 0.7rem;
    min-height: 4.8rem;
    padding: 0.65rem 0.75rem;
  }

  .gmail-row-avatar {
    grid-row: 1 / 3;
  }

  .gmail-message-row strong {
    align-self: end;
  }

  .gmail-row-subject {
    grid-column: 2 / 4;
    align-self: start;
    color: #5f6368;
  }

  .gmail-message-row time {
    grid-column: 3;
    grid-row: 1;
  }

  .gmail-reader-head,
  .gmail-message-body {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .gmail-sender-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .gmail-sender-row time {
    grid-column: 2;
  }

  .gmail-compose-window {
    position: absolute;
    inset: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .gmail-compose-form textarea {
    min-height: calc(100vh - 24rem);
  }

  .gmail-compose-form footer {
    flex-wrap: wrap;
  }

  .gmail-shell.is-reading .gmail-sidebar,
  .gmail-shell.is-composing .gmail-sidebar {
    display: none;
  }

  .gmail-shell.is-reading .gmail-content,
  .gmail-shell.is-composing .gmail-content {
    min-height: calc(100vh - 9.5rem);
  }

  .messages-layout.has-chat .people-panel {
    display: none;
  }

  .messages-layout:not(.has-chat) .chat-panel {
    display: none;
  }

  .chat-panel {
    height: calc(100dvh - 9.2rem);
    min-height: 28rem;
    grid-template-rows: auto 1fr auto;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.private-chat-open {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    background: #ffffff;
  }

  body.private-chat-open .app-top,
  body.private-chat-open .bottom-nav {
    display: none;
  }

  body.private-chat-open .app-main {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
  }

  body.private-chat-open .messages-layout.has-chat,
  body.private-chat-open .chat-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  body.private-chat-open .chat-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.private-chat-open .chat-head {
    min-height: 4.45rem;
    padding: max(0.55rem, env(safe-area-inset-top)) 0.75rem 0.55rem;
  }

  body.private-chat-open .chat-head .avatar-mini {
    width: 2.55rem;
    height: 2.55rem;
  }

  body.private-chat-open .chat-head .person-link small.muted {
    display: none;
  }

  body.private-chat-open .chat-feed {
    padding: 0.8rem 0.75rem;
  }

  body.private-chat-open .bubble {
    max-width: 82%;
  }

  body.private-chat-open .chat-form {
    padding: 0.55rem 0.65rem max(0.55rem, env(safe-area-inset-bottom));
  }

  .bottom-inner {
    overflow-x: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(4.35rem, 1fr);
    grid-template-columns: none;
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
  }

  .tab {
    min-height: 3.9rem;
    font-size: 0.68rem;
  }

  .post-meta,
  .post-body,
  .actions,
  .comments-strip {
    padding-left: 0.78rem;
    padding-right: 0.78rem;
  }

  .comment-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .gallery-admin-grid.is-sorting {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Admin-only post view details */
.post-viewers-panel {
  width: fit-content;
  max-width: calc(100% - 1.6rem);
  margin: 0.55rem 0.8rem 0.8rem auto;
}

.post-viewers-panel[open] {
  width: min(20rem, calc(100% - 1.6rem));
}

.post-viewers-panel > summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  width: fit-content;
  min-height: 2rem;
  margin-left: auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(18, 59, 44, 0.12);
  border-radius: 999px;
  background: rgba(243, 247, 244, 0.78);
  color: #65766f;
  cursor: pointer;
  list-style: none;
  font-size: 0.72rem;
  font-weight: 850;
}

.post-viewers-panel > summary::-webkit-details-marker { display: none; }
.post-viewers-panel > summary svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.post-viewers-popover { display: grid; gap: 0.35rem; max-height: 15rem; margin-top: 0.4rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.55rem; background: #f8faf9; }
.post-viewers-popover > strong { padding: 0.2rem 0.25rem; color: #10251d; font-size: 0.74rem; }
.post-viewers-popover > p { margin: 0; padding: 0.5rem 0.25rem; color: var(--muted); font-size: 0.72rem; }
.post-viewers-popover > a { display: flex; align-items: center; gap: 0.5rem; min-width: 0; border-radius: 0.5rem; padding: 0.4rem; background: #fff; }
.post-viewers-popover > a > span:last-child { display: grid; min-width: 0; }
.post-viewers-popover b { overflow: hidden; color: #10251d; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.post-viewers-popover small { color: var(--muted); font-size: 0.63rem; }

/* Announcement chat aligned with private messages */
.notice-chat-shell { height: calc(100dvh - 10.7rem); min-height: 28rem; border-radius: 1rem; }
.notice-chat-head { min-height: 4.4rem; background: rgba(248, 250, 249, 0.94); }
.notice-chat-messages { gap: 0.75rem; padding: 1rem; overflow-x: hidden; scroll-behavior: smooth; }
.notice-chat-bubble { display: flex; align-items: flex-end; gap: 0.5rem; width: fit-content; max-width: min(88%, 38rem); padding: 0; border-radius: 0; background: transparent; overflow: visible; }
.notice-chat-bubble.mine { align-self: flex-end; flex-direction: row-reverse; background: transparent; color: inherit; }
.notice-chat-avatar { display: grid; place-items: center; flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; background: #dfe9e3; color: #123b2c; font-size: 0.65rem; font-weight: 950; }
.notice-chat-content { min-width: 0; border-radius: 1rem 1rem 1rem 0.3rem; padding: 0.65rem 0.8rem; background: #edf3ef; box-shadow: 0 8px 22px rgba(16, 37, 29, 0.06); }
.notice-chat-bubble.mine .notice-chat-content { border-radius: 1rem 1rem 0.3rem 1rem; background: #123b2c; color: #fff; }
.notice-chat-content > strong { display: block; margin-bottom: 0.18rem; font-size: 0.68rem; opacity: 0.72; }
.notice-chat-content > p { max-width: 100%; margin: 0; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }
.notice-chat-content footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.3rem; margin-top: 0.35rem; }
.notice-chat-content footer small { opacity: 0.62; }
.notice-chat-delete { display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border: 0; border-radius: 50%; padding: 0; background: transparent; color: currentColor; opacity: 0.6; cursor: pointer; }
.notice-chat-delete:hover, .notice-chat-delete:focus-visible { background: rgba(255, 255, 255, 0.14); opacity: 1; }
.notice-chat-delete svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice-chat-form { align-items: end; padding: 0.7rem; background: #fff; }
.notice-chat-form textarea { width: 100%; min-width: 0; max-height: 7.5rem; resize: none; border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.78rem 0.9rem; outline: none; line-height: 1.35; }
.notice-chat-form textarea:focus { border-color: #123b2c; box-shadow: 0 0 0 4px rgba(47, 125, 91, 0.12); }
.notice-chat-form button { min-height: 2.9rem; border-radius: 0.7rem; }

/* First-login account setup */
.onboarding-card { width: min(34rem, 100%); }
.onboarding-card h1 { margin-bottom: 0.55rem; }
.onboarding-intro { margin: 0 auto 1rem; color: var(--muted); text-align: center; line-height: 1.45; }
.onboarding-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.65rem; margin: 1.1rem 0 1.3rem; }
.onboarding-progress > i { height: 1px; background: #dbe5df; }
.onboarding-progress > span { display: grid; grid-template-columns: 1.8rem auto; align-items: center; gap: 0.4rem; color: #91a099; }
.onboarding-progress b { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border: 1px solid #cad8d0; border-radius: 50%; font-size: 0.7rem; }
.onboarding-progress small { font-size: 0.68rem; font-weight: 850; }
.onboarding-progress span.is-active { color: #123b2c; }
.onboarding-progress span.is-active b { border-color: #123b2c; background: #123b2c; color: #fff; }
.onboarding-step { display: none; gap: 0.85rem; animation: fadeUp 0.3s ease both; }
.onboarding-step.is-active { display: grid; }
.onboarding-step-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.2rem; }
.onboarding-step-head > span { color: #2f7d5b; font-size: 0.7rem; font-weight: 950; }
.onboarding-step-head > div { display: grid; gap: 0.1rem; }
.onboarding-step-head strong { color: #10251d; }
.onboarding-step-head small { color: var(--muted); font-size: 0.72rem; }
.onboarding-photo-field { gap: 0.55rem !important; }
.onboarding-photo-preview { display: flex; align-items: center; gap: 0.8rem; min-height: 4.4rem; border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.6rem; background: #f6f9f7; }
.onboarding-photo-preview > b, .onboarding-photo-preview > img { display: grid; place-items: center; flex: 0 0 3.2rem; width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; background: #123b2c; color: #fff; }
.onboarding-photo-preview small { color: var(--muted); font-size: 0.75rem; }
.onboarding-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.onboarding-final-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; }
.onboarding-final-actions .login-submit { margin: 0; }

@media (max-width: 760px) {
  .notice-chat-shell { height: calc(100dvh - 9.2rem); min-height: 0; border-radius: 0.75rem; }
  .notice-chat-messages { padding: 0.75rem; }
  .notice-chat-bubble { max-width: 94%; }
  .notice-chat-form { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: max(0.7rem, env(safe-area-inset-bottom)); }
  .notice-chat-form button { padding-inline: 0.85rem; }
}

/* Compact FMB feed, 24-hour moments and rich private messages */
.feed {
  width: min(46rem, 100%);
  margin-inline: auto;
  gap: 0.85rem;
}

.post-card {
  min-height: 0;
  border-radius: 0.72rem;
  scroll-snap-align: none;
  box-shadow: 0 12px 36px rgba(11, 48, 38, 0.08);
}

.post-photo {
  aspect-ratio: 4 / 3;
  max-height: 36rem;
}

.post-video-wrap {
  min-height: min(55vh, 31rem);
}

.post-meta {
  padding: 0.72rem 0.82rem;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.post-meta .avatar-mini {
  width: 2.55rem;
  height: 2.55rem;
}

.post-body {
  padding: 0.7rem 0.82rem 0.55rem;
}

.post-body .caption {
  font-size: 0.92rem;
  line-height: 1.48;
}

.actions {
  align-items: center;
  gap: 0.42rem;
  padding: 0.2rem 0.82rem 0.78rem;
}

.support-reaction,
.feed-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 2.45rem;
  border: 1px solid #dce6e0;
  border-radius: 0.58rem;
  padding: 0 0.72rem;
  background: #f8faf9;
  color: #16382d;
  font-size: 0.79rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.support-reaction:hover,
.feed-action-icon:hover,
.support-reaction:focus-visible,
.feed-action-icon:focus-visible {
  transform: translateY(-1px);
  border-color: #8eaa9d;
}

.support-reaction > span:first-child {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #ffffff;
}

.support-reaction svg,
.feed-action-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-reaction.is-liked,
.support-reaction.is-active {
  border-color: #0b3026;
  background: #0b3026;
  color: #ffffff;
}

.support-reaction.is-liked > span:first-child,
.support-reaction.is-active > span:first-child {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.support-reaction {
  min-height: 2.45rem;
  border: 0;
  border-radius: 0.52rem;
  padding: 0.28rem 0.4rem;
  background: transparent;
  color: #123b2c;
}

.support-reaction > span:first-child {
  width: 1.62rem;
  height: 1.62rem;
  border: 0;
  background: transparent;
}

.support-reaction svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: transparent;
  stroke-width: 1.8;
  transition: transform 0.18s ease, fill 0.18s ease;
}

.support-reaction:hover,
.support-reaction:focus-visible {
  border-color: transparent;
  background: #edf6f1;
}

.support-reaction:hover svg {
  transform: scale(1.08);
}

.support-reaction.is-liked,
.support-reaction.is-active {
  border-color: transparent;
  background: transparent;
  color: #2f7d5b;
}

.support-reaction.is-liked > span:first-child,
.support-reaction.is-active > span:first-child {
  border: 0;
  background: transparent;
}

.support-reaction.is-liked svg,
.support-reaction.is-active svg {
  fill: currentColor;
}

.support-reaction b {
  min-width: 1ch;
  font-size: 0.78rem;
}

.feed-create-actions {
  display: flex;
  justify-content: flex-end;
  width: min(46rem, 100%);
  margin: 0 auto 0.7rem;
  gap: 0.42rem;
}

.feed-create-icon {
  position: relative;
  display: inline-flex;
  place-items: center;
  justify-content: center;
  gap: 0.48rem;
  flex: 0 0 auto;
  width: auto;
  min-width: 7.1rem;
  height: 3.05rem;
  overflow: visible;
  border: 1px solid rgba(18, 59, 44, 0.18);
  border-radius: 0.62rem;
  background: #ffffff;
  color: #123b2c;
  box-shadow: 0 7px 20px rgba(11, 48, 38, 0.08);
  padding: 0 0.85rem;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.feed-create-icon:hover,
.feed-create-icon:focus-visible {
  transform: translateY(-2px);
  background: #123b2c;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(11, 48, 38, 0.2);
}

.feed-create-icon > span,
.feed-create-icon .feed-new-post-icon {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.feed-create-icon svg,
.feed-create-icon .feed-new-post-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.85;
}

.feed-create-label {
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.feed-create-icon::after {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 5;
  width: max-content;
  max-width: 10rem;
  border-radius: 0.38rem;
  padding: 0.35rem 0.48rem;
  background: #10251d;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.feed-create-post::after { content: "Postare noua"; }
.feed-create-notice::after { content: "Anunt nou"; }

.feed-create-icon:hover::after,
.feed-create-icon:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.feed-create-icon::after {
  display: none;
}

.feed-comment-toggle {
  font: inherit;
}

.feed-comment-toggle.is-active {
  border-color: #123b2c;
  background: #123b2c;
  color: #ffffff;
}

.comments-strip:not(.is-open) {
  gap: 0;
  padding-top: 0;
}

.comments-strip:not(.is-open) .mini-comment {
  display: none;
}

.comments-strip:not(.is-open) .mini-comment:last-of-type {
  display: flex;
}

.comments-strip:not(.is-open) .comment-inline {
  display: none;
}

.comments-strip.is-empty:not(.is-open) {
  display: none;
}

.comments-strip.is-open {
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  animation: fadeUp 0.22s ease both;
}

.feed-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.65rem;
  width: min(46rem, 100%);
  margin: 1rem auto 7rem;
}

.feed-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.58rem;
  padding: 0 0.8rem;
  background: #ffffff;
  color: #123b2c;
  font-size: 0.78rem;
  font-weight: 900;
}

.feed-pagination a:last-child {
  grid-column: 3;
}

.feed-pagination span {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .feed-pagination {
    grid-template-columns: 1fr 1fr;
  }

  .feed-pagination span {
    display: none;
  }

  .feed-pagination a:last-child {
    grid-column: 2;
  }
}

.story-rail {
  width: min(50rem, 100%);
  margin: 0 auto 1rem;
  padding: 0.78rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 38px rgba(11, 48, 38, 0.07);
  animation: fadeUp 0.4s ease both;
}

.story-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.story-rail-head > div {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.story-rail-head span {
  display: inline-grid;
  place-items: center;
  min-width: 2.45rem;
  height: 1.45rem;
  border-radius: 0.32rem;
  background: #0b3026;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 950;
}

.story-rail-head strong {
  color: #10251d;
  font-size: 0.9rem;
}

.story-rail-head small {
  color: var(--muted);
  font-size: 0.7rem;
}

.story-track {
  display: flex;
  gap: 0.58rem;
  overflow-x: auto;
  padding: 0.08rem 0.08rem 0.28rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.story-card,
.story-add-card {
  position: relative;
  flex: 0 0 7.25rem;
  width: 7.25rem;
  height: 10rem;
  overflow: hidden;
  border: 1px solid rgba(16, 37, 29, 0.16);
  border-radius: 0.62rem;
  padding: 0;
  background: #0b1712;
  color: #ffffff;
  scroll-snap-align: start;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.story-card:hover,
.story-add-card:hover,
.story-card:focus-visible,
.story-add-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 48, 38, 0.2);
}

.story-card > img,
.story-card > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-shade {
  position: absolute;
  inset: 38% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
  pointer-events: none;
}

.story-card-author {
  position: absolute;
  right: 0.48rem;
  bottom: 1.28rem;
  left: 0.48rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.story-card-author .avatar-mini {
  width: 1.45rem;
  height: 1.45rem;
  border-color: rgba(255, 255, 255, 0.55);
}

.story-card-author strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-card > small {
  position: absolute;
  right: 0.48rem;
  bottom: 0.38rem;
  left: 0.48rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.57rem;
}

.story-video-mark {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  border-radius: 0.32rem;
  padding: 0.25rem 0.35rem;
  background: rgba(0, 0, 0, 0.64);
  color: #ffffff;
  font-size: 0.56rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.story-add-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.72rem;
  background: linear-gradient(155deg, #123f34, #07130f);
}

.story-add-card > span {
  position: absolute;
  top: 0.72rem;
  left: 0.72rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.5rem;
  font-weight: 300;
}

.story-add-card strong {
  font-size: 0.82rem;
}

.story-add-card small {
  margin-top: 0.12rem;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.62rem;
}

.story-empty {
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

body.story-open {
  overflow: hidden;
}

.story-viewer[hidden] {
  display: none;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #020504;
  color: #ffffff;
  animation: storyReveal 0.24s ease both;
}

.story-viewer-progress,
.story-viewer > header,
.story-viewer-media,
.story-viewer-copy,
.story-reply-form,
.story-delete-form,
.story-reply-status {
  width: min(31rem, 100%);
  margin-inline: auto;
}

.story-viewer-progress {
  height: 0.18rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.story-viewer-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  background: #ffffff;
  animation: storyProgress 8s linear both;
}

.story-viewer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.1rem;
  padding: max(0.65rem, env(safe-area-inset-top)) 0.85rem 0.65rem;
}

.story-viewer-author {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.story-viewer-author > span {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: #153d31;
  font-size: 0.68rem;
  font-weight: 950;
}

.story-viewer > header button {
  width: 2.45rem;
  height: 2.45rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.45rem;
  cursor: pointer;
}

.story-viewer-media {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: #050806;
}

.story-viewer-media img,
.story-viewer-media video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.story-viewer-copy {
  padding: 0.65rem 0.85rem 0.5rem;
}

.story-viewer-copy p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.story-viewer-copy a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  color: #bfead6;
  font-size: 0.78rem;
  font-weight: 900;
}

.story-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.7rem;
  gap: 0.5rem;
  padding: 0.55rem 0.72rem max(0.65rem, env(safe-area-inset-bottom));
}

.story-reply-form[hidden] {
  display: none;
}

.story-reply-form input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.72rem 0.95rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  outline: none;
}

.story-reply-form input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.story-reply-form button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #0b3026;
  cursor: pointer;
}

.story-reply-form svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.story-delete-form {
  padding: 0 0.72rem 0.5rem;
}

.story-delete-form[hidden] {
  display: none;
}

.story-delete-form button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #ff9d9d;
  font-size: 0.72rem;
  cursor: pointer;
}

.story-reply-status {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 0.72rem 0.55rem;
  color: #c7eadb;
  font-size: 0.72rem;
}

.story-compose-shell {
  width: min(35rem, calc(100% - 1.5rem));
  margin: 1rem auto 7rem;
  padding: clamp(1rem, 4vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(11, 48, 38, 0.11);
}

.story-compose-shell header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.story-compose-shell h1 {
  margin: 0;
  color: #10251d;
  font-size: 1.35rem;
}

.story-compose-shell header p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.story-compose-back {
  display: grid;
  place-items: center;
  flex: 0 0 2.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: #edf3ef;
  color: #0b3026;
  font-size: 1.5rem;
}

.story-compose-form {
  display: grid;
  gap: 0.9rem;
}

.story-media-picker {
  display: grid;
  place-items: center;
  min-height: 15rem;
  border: 1px dashed #9fb4aa;
  border-radius: 0.72rem;
  padding: 1rem;
  background: #f5f8f6;
  color: #16382d;
  text-align: center;
  cursor: pointer;
}

.story-media-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.story-picker-icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background: #0b3026;
  color: #ffffff;
}

.story-picker-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

.story-media-picker small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-form {
  grid-template-columns: 2.8rem minmax(0, 1fr) 2.8rem;
}

.chat-attach-button {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f5f8f6;
  color: var(--green);
  cursor: pointer;
}

.chat-attach-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chat-attach-button svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 1.8;
}

.chat-media-name {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.42rem;
  padding: 0.38rem 0.55rem;
  background: #edf3ef;
  color: #315044;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-media-button {
  display: block;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0.72rem;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.message-media-button img,
.message-media-video {
  display: block;
  width: min(18rem, 68vw);
  max-width: 100%;
  max-height: 23rem;
  border-radius: 0.72rem;
  object-fit: contain;
  background: #07110d;
}

.message-story-reply {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  margin-bottom: 0.48rem;
  overflow: hidden;
  border-left: 0.18rem solid currentColor;
  border-radius: 0.45rem;
  padding: 0.38rem;
  background: rgba(255, 255, 255, 0.18);
}

.message-story-reply img,
.message-story-reply video {
  width: 3.25rem;
  height: 3.6rem;
  border-radius: 0.35rem;
  object-fit: cover;
}

.message-story-reply span {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.message-story-reply small,
.message-story-reply strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-story-reply small {
  font-size: 0.62rem;
  opacity: 0.72;
}

.message-story-reply strong {
  font-size: 0.73rem;
}

.message-media-viewer[hidden] {
  display: none;
}

.message-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.92);
}

.message-media-viewer img {
  max-width: 100%;
  max-height: 92dvh;
  object-fit: contain;
}

.message-media-viewer button {
  position: fixed;
  top: max(0.8rem, env(safe-area-inset-top));
  right: 0.8rem;
  z-index: 1;
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.45rem;
  cursor: pointer;
}

@keyframes storyReveal {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes storyProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .feed {
    scroll-snap-type: none;
  }

  .post-card {
    min-height: 0;
  }

  .feed-create-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 0.55rem;
  }

  .feed-create-icon {
    flex-basis: auto;
    width: auto;
    min-width: 6.6rem;
    height: 2.85rem;
    padding-inline: 0.72rem;
  }

  .feed-create-icon::after {
    display: none;
  }

  .feed-create-label {
    font-size: 0.74rem;
  }

  .post-photo {
    aspect-ratio: auto;
    max-height: 68dvh;
    object-fit: contain;
    background: #050806;
  }

  .post-video-wrap {
    min-height: 0;
  }

  .post-video {
    max-height: 68dvh;
  }

  .story-rail {
    width: calc(100% + 0.5rem);
    margin-left: -0.25rem;
    padding: 0.68rem 0.55rem;
  }

  .story-rail-head small {
    display: none;
  }

  .story-card,
  .story-add-card {
    flex-basis: 6.65rem;
    width: 6.65rem;
    height: 9.3rem;
  }

  body.private-chat-open .chat-form {
    grid-template-columns: 2.65rem minmax(0, 1fr) 2.65rem;
    gap: 0.4rem;
  }

  body.private-chat-open .chat-attach-button,
  body.private-chat-open .chat-send-button {
    width: 2.65rem;
    height: 2.65rem;
  }

  .message-media-button img,
  .message-media-video {
    width: min(17rem, 72vw);
    max-height: 48dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-viewer,
  .story-viewer-progress span {
    animation: none;
  }
}

@media (max-width: 480px) {
  .onboarding-profile-grid { grid-template-columns: 1fr; }
  .onboarding-final-actions { grid-template-columns: 1fr; }
  .onboarding-final-actions .button { width: 100%; }
}

/* Statistics control center */
.stats-dashboard {
  --stats-ink: #0d261d;
  --stats-green: #174f3b;
  --stats-soft: #f2f7f4;
  width: min(76rem, 100%);
  margin-inline: auto;
  gap: 1rem;
  padding-bottom: 6rem;
}

.stats-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0 0.35rem;
}

.stats-heading > div { min-width: 0; }
.stats-heading .stats-eyebrow,
.stats-section-head > div > span {
  display: block;
  margin-top: 0.8rem;
  color: #73847c;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stats-heading h1 { margin-top: 0.12rem; font-size: clamp(1.75rem, 4vw, 2.65rem); letter-spacing: 0; }
.stats-export {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  min-height: 2.7rem;
  border: 1px solid #d8e3dd;
  border-radius: 8px;
  padding: 0 0.8rem;
  background: #fff;
  color: var(--stats-ink);
  font-size: 0.76rem;
  font-weight: 850;
}
.stats-export svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stats-periods {
  display: flex;
  gap: 0.25rem;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  padding: 0.25rem;
  background: #fff;
}
.stats-periods a { min-width: 4.5rem; border-radius: 6px; padding: 0.55rem 0.75rem; color: #63736c; font-size: 0.73rem; font-weight: 850; text-align: center; white-space: nowrap; }
.stats-periods a.is-active { background: var(--stats-ink); color: #fff; }

.stats-hero-grid { display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.stats-primary-card,
.stats-summary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 9.2rem;
  overflow: hidden;
  border: 1px solid #dae6df;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}
.stats-primary-card { border-color: var(--stats-ink); background: var(--stats-ink); color: #fff; }
.stats-primary-card::after { content: ""; position: absolute; right: -2.5rem; bottom: -4rem; width: 10rem; height: 10rem; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 1.8rem rgba(255,255,255,.025), 0 0 0 3.6rem rgba(255,255,255,.018); }
.stats-primary-card > span,
.stats-summary-card > span { margin-top: auto; color: inherit; font-size: 0.72rem; font-weight: 800; opacity: 0.7; }
.stats-primary-card > strong,
.stats-summary-card > strong { margin-top: 0.2rem; color: inherit; font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1; }
.stats-primary-card > small,
.stats-summary-card > small { margin-top: 0.45rem; color: inherit; font-size: 0.65rem; opacity: 0.66; }
.stats-card-icon { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 7px; background: var(--stats-soft); color: var(--stats-green); }
.stats-primary-card .stats-card-icon { background: rgba(255,255,255,.1); color: #fff; }
.stats-card-icon svg,
.stats-device-grid svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stats-summary-card.is-live small { display: flex; align-items: center; gap: 0.35rem; }
.stats-summary-card.is-live i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #26a269; box-shadow: 0 0 0 0.25rem rgba(38,162,105,.12); }
.stats-trend.is-up { color: #9ce2bd !important; opacity: 1 !important; }
.stats-trend.is-down { color: #ffc0c0 !important; opacity: 1 !important; }

.stats-section { border: 1px solid #dde7e2; border-radius: 8px; padding: 1rem; background: #fff; }
.stats-section-head { display: flex; align-items: end; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.85rem; }
.stats-section-head > div > span { margin: 0 0 0.16rem; }
.stats-section-head h2 { margin: 0; font-size: 1.05rem; }
.stats-section-head > small,
.stats-section-head > a { color: #708078; font-size: 0.7rem; font-weight: 750; }

.stats-chart-section { overflow: hidden; }
.stats-chart { grid-template-columns: repeat(var(--stats-columns, 7), minmax(1.25rem, 1fr)); height: 13rem; margin: 0; overflow-x: auto; border: 0; border-radius: 0; padding: 0.7rem 0 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #edf2ef 25%); }
.stats-bar-column { min-width: 1.25rem; }
.stats-bar-column > div { border-bottom: 0; }
.stats-bar-column > div span { width: min(74%, 2rem); border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #2f8060, #123b2c); box-shadow: 0 5px 16px rgba(18,59,44,.16); transform-origin: bottom; animation: statsBarRise .6s ease both; }
@keyframes statsBarRise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

.stats-audience { align-items: start; }
.stats-progress-list { display: grid; gap: 0.75rem; }
.stats-progress-list > div { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(5rem, 1.2fr); align-items: center; gap: 0.7rem; }
.stats-progress-list span { min-width: 0; }
.stats-progress-list b { display: block; overflow: hidden; color: var(--stats-ink); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.stats-progress-list small { display: block; color: #7a8982; font-size: 0.62rem; }
.stats-progress-list i { height: 0.38rem; overflow: hidden; border-radius: 999px; background: #edf2ef; }
.stats-progress-list em { display: block; height: 100%; border-radius: inherit; background: var(--stats-green); }
.stats-device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.55rem; }
.stats-device-grid article { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 0.2rem 0.55rem; border: 1px solid #e1e9e4; border-radius: 8px; padding: 0.75rem; background: #f8faf9; }
.stats-device-grid svg { grid-row: 1 / 3; align-self: center; width: 1.4rem; color: var(--stats-green); }
.stats-device-grid span { overflow: hidden; color: #6a7c73; font-size: 0.64rem; text-overflow: ellipsis; white-space: nowrap; }
.stats-device-grid strong { color: var(--stats-ink); font-size: 1.1rem; }

.stats-grid { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.stats-tile { min-height: 5.4rem; border-radius: 8px; padding: 0.8rem; background: #fbfcfb; }
.stats-tile strong { font-size: 1.42rem; }
.stats-tile.is-attention { border-left: 3px solid #d8a62e; }
.stats-tile.is-success { border-left: 3px solid #2f8060; }
.stats-tile.is-danger { border-left: 3px solid #bd4d4d; }
.stats-list > div { border: 1px solid #e5ece8; border-radius: 7px; }
.stats-list > .stats-visit-row { padding: 0.8rem; }

.feed-download-action { margin-left: auto; }
.feed-download-action svg { width: 1.15rem; height: 1.15rem; }

@media (max-width: 900px) {
  .stats-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-primary-card { grid-column: span 2; }
}

@media (max-width: 650px) {
  .stats-dashboard { gap: 0.7rem; }
  .stats-heading { align-items: start; }
  .stats-heading p { max-width: 18rem; }
  .stats-export { width: 2.7rem; padding: 0; justify-content: center; }
  .stats-export span { display: none; }
  .stats-hero-grid { gap: 0.5rem; }
  .stats-primary-card,
  .stats-summary-card { min-height: 8.2rem; padding: 0.8rem; }
  .stats-section { padding: 0.8rem; }
  .stats-audience { display: grid; gap: 1.3rem; }
  .stats-chart { height: 11rem; }
  .stats-list > .stats-visit-row { grid-template-columns: minmax(0, 1fr); }
  .stats-list > .stats-visit-row time { grid-row: 1; justify-self: end; }
  .stats-visit-person { grid-row: 1; padding-right: 6rem; }
  .stats-visit-tags { grid-column: 1; }
  .actions { flex-wrap: wrap; }
  .feed-download-action { margin-left: 0; }
}
