/*
Theme Name: Forum Crossing
Theme URI: https://forumcrossing.mapage-wp.online
Author: Mapage
Description: Thème communautaire mobile-first pour un chat insulaire multi-room.
Version: 1.0.0
Text Domain: forumcrossing
*/

:root {
  --ink: #17434a;
  --ink-soft: #4e7073;
  --cream: #fffaf0;
  --paper: #ffffff;
  --mint: #dff5df;
  --mint-dark: #2a806f;
  --aqua: #52c7c8;
  --aqua-dark: #11727b;
  --coral: #dd5d4d;
  --yellow: #ffd866;
  --sand: #f3dfb4;
  --line: #d5e6dd;
  --shadow: 0 14px 40px rgba(23, 67, 74, .13);
  --radius: 26px;
  --font: "Nunito", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(#2a806f 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: -1;
}
a { color: var(--aqua-dark); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
button, .fc-button { cursor: pointer; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus { width: auto; height: auto; margin: 8px; padding: 12px; clip: auto; background: #fff; z-index: 9999; }
.fc-container { width: min(1180px, calc(100% - 28px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 250, 240, .96);
  border-bottom: 1px solid rgba(23, 67, 74, .12);
  backdrop-filter: blur(14px);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 16px; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px;
  border: 3px solid #fff; border-radius: 50% 46% 50% 44%; background: var(--aqua); box-shadow: 0 5px 0 #b9e4d8;
  font-size: 25px;
}
.brand-text strong { display: block; font-size: 19px; line-height: 1; }
.brand-text small { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.account-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 900; box-shadow: 0 4px 15px rgba(23, 67, 74, .09); }
.account-chip:hover, .account-chip:focus-visible { color: var(--aqua-dark); outline: 3px solid rgba(82,199,200,.28); }
.notification-toggle { position: relative; display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 4px 15px rgba(23,67,74,.09); font-size: 21px; }
.notification-toggle:hover, .notification-toggle:focus-visible { outline: 3px solid rgba(82,199,200,.28); background: var(--mint); }
.notification-dot { position: absolute; top: 5px; right: 4px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #e94f45; box-shadow: 0 0 0 2px rgba(233,79,69,.15); }
.notification-dot[hidden] { display: none !important; }

.app-nav { border-top: 1px solid var(--line); background: #fff; }
.app-nav-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.app-nav a {
  position: relative; display: flex; min-height: 62px; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 7px 2px; color: var(--ink-soft); text-decoration: none; font-size: 11px; font-weight: 900;
}
.app-nav a:hover, .app-nav a:focus-visible, .app-nav a.is-current { color: var(--aqua-dark); background: var(--mint); }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-badge { position: absolute; top: 5px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 10px; line-height: 18px; }

.fc-hero {
  position: relative; min-height: 560px; display: grid; align-items: center; overflow: hidden;
  background-color: #72c8ee;
  background-image: linear-gradient(90deg, rgba(255,250,240,.97) 0%, rgba(255,250,240,.86) 34%, rgba(255,250,240,.12) 65%), var(--fc-hero);
  background-size: cover; background-position: 58% center;
}
.fc-hero::after { content: ""; position: absolute; right: -55px; bottom: -65px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,216,102,.7); }
.hero-copy { position: relative; z-index: 2; max-width: 590px; padding: 64px 0 90px; }
.fc-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--aqua-dark); font-size: 13px; font-weight: 1000; letter-spacing: .13em; text-transform: uppercase; }
.fc-kicker::before { content: ""; width: 36px; height: 5px; border-radius: 9px; background: var(--yellow); }
h1, h2, h3 { color: var(--ink); line-height: 1.08; }
.fc-hero h1 { max-width: 560px; margin: 0 0 18px; font-size: clamp(43px, 8vw, 76px); letter-spacing: -.045em; }
.fc-hero p { max-width: 525px; margin: 0 0 28px; font-size: clamp(18px, 2.5vw, 22px); color: #315c60; }
.hero-actions, .fc-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fc-button, button.fc-button, input.fc-button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px;
  border: 0; border-radius: 999px; background: var(--coral); color: #fff; text-decoration: none; font-weight: 1000;
  box-shadow: 0 7px 0 rgba(161, 65, 53, .18); transition: transform .15s, box-shadow .15s;
}
.fc-button:hover, .fc-button:focus-visible { color: #fff; transform: translateY(-2px); box-shadow: 0 9px 0 rgba(161,65,53,.18); }
.fc-button.secondary { background: #fff; color: var(--ink); border: 2px solid var(--aqua); box-shadow: none; }
.fc-button.small { min-height: 38px; padding: 8px 14px; font-size: 14px; }

.fc-section { padding: 70px 0; }
.fc-section.soft { background: rgba(223,245,223,.72); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-head h2 { margin: 4px 0 0; font-size: clamp(32px, 5vw, 50px); letter-spacing: -.035em; }
.section-head p { margin: 0; color: var(--ink-soft); }

.room-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.room-card {
  position: relative; overflow: hidden; display: flex; min-height: 205px; flex-direction: column; justify-content: space-between;
  padding: 24px; border: 1px solid rgba(23,67,74,.1); border-radius: var(--radius); background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.room-card:hover, .room-card:focus-visible { color: var(--ink); transform: translateY(-5px) rotate(-.3deg); box-shadow: 0 20px 50px rgba(23,67,74,.18); }
.room-card::after { content: attr(data-emoji); position: absolute; right: -10px; bottom: -22px; font-size: 92px; opacity: .16; transform: rotate(-9deg); }
.room-card:nth-child(4n+1) { background: #fff1d1; }
.room-card:nth-child(4n+2) { background: #dff7f3; }
.room-card:nth-child(4n+3) { background: #ffe8e3; }
.room-card:nth-child(4n+4) { background: #e6efff; }
.room-card h3 { margin: 12px 0 6px; font-size: 25px; }
.room-card p { margin: 0; color: var(--ink-soft); }
.room-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; font-size: 13px; font-weight: 900; }
.status-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: #3ab66b; box-shadow: 0 0 0 4px rgba(58,182,107,.14); }

.feature-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.feature { padding: 26px; border-radius: var(--radius); background: #fff; text-align: center; box-shadow: var(--shadow); }
.feature span { display: grid; width: 64px; height: 64px; margin: 0 auto 14px; place-items: center; border-radius: 22px; background: var(--mint); font-size: 31px; transform: rotate(-3deg); }
.feature h3 { margin: 0 0 7px; font-size: 21px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.fc-page-hero { padding: 52px 0 38px; background: linear-gradient(135deg, var(--mint), #d9f1ff); text-align: center; }
.fc-page-hero h1 { margin: 7px 0; font-size: clamp(38px, 6vw, 62px); letter-spacing: -.04em; }
.fc-page-hero p { margin: 0 auto; max-width: 680px; color: var(--ink-soft); }
.fc-content { padding: 42px 0 80px; }
.fc-panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

.chat-layout { display: grid; gap: 18px; }
.chat-sidebar { display: none; }
.chat-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; background: var(--mint); border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 22px; }
.chat-messages { height: min(54vh, 510px); min-height: 380px; overflow-y: auto; padding: 22px 16px; background: linear-gradient(#fff, #fbfefc); }
.chat-empty { display: grid; height: 100%; place-items: center; color: var(--ink-soft); text-align: center; }
.chat-message { display: grid; grid-template-columns: 38px 1fr; gap: 10px; margin: 0 0 17px; }
.chat-message.is-mine { grid-template-columns: 1fr 38px; }
.chat-message.is-mine .fc-avatar { grid-column: 2; }
.chat-message.is-mine .message-main { grid-row: 1; grid-column: 1; align-items: flex-end; }
.message-main { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.message-byline { margin: 0 7px 4px; color: var(--ink-soft); font-size: 12px; font-weight: 900; }
.message-bubble { max-width: min(600px, 90%); padding: 10px 14px; border-radius: 18px 18px 18px 5px; background: #edf6f1; overflow-wrap: anywhere; }
.is-mine .message-bubble { border-radius: 18px 18px 5px 18px; background: #d9f3f3; }
.fc-avatar { display: grid; width: 38px; height: 38px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 1000; }
.fc-avatar.is-online {
  overflow: visible;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #35b96f;
}
.fc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-compose { padding: 15px; border-top: 1px solid var(--line); background: #fffaf0; }
.chat-compose form { display: flex; gap: 9px; align-items: end; }
.chat-compose textarea { flex: 1; min-height: 48px; max-height: 120px; resize: vertical; padding: 11px 14px; border: 2px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; }
.chat-compose textarea:focus { outline: 3px solid rgba(82,199,200,.25); border-color: var(--aqua); }
.chat-compose .fc-button { width: 48px; height: 48px; padding: 0; flex: 0 0 48px; font-size: 20px; }
.chat-notice { padding: 17px; border-top: 1px solid var(--line); text-align: center; background: #fffaf0; }

.member-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.member-card { display: flex; min-height: 238px; flex-direction: column; padding: 18px 10px 12px; border: 1px solid var(--line); border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 8px 22px rgba(23,67,74,.08); }
.member-card .fc-avatar { width: 64px; height: 64px; margin: 0 auto 10px; font-size: 24px; }
.member-card h3 { margin: 0 0 2px; font-size: 17px; }
.member-card p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.member-card .online { color: #267c4b; font-weight: 900; }
.member-card-actions { display: grid; gap: 6px; width: 100%; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 900; }
.member-card-actions a, .member-friend-link { color: var(--aqua-dark); text-decoration: underline; text-underline-offset: 3px; }
.member-friend-link { padding: 0; border: 0; background: transparent; font: inherit; }
.member-friend-link:disabled { color: var(--ink-soft); cursor: wait; }
.member-friend-state { color: var(--ink-soft); }
.fc-user-search { width: min(100%, 560px); margin: 0 0 22px; }
.fc-user-search input, .fc-form .fc-user-search input { width: 100%; min-height: 52px; padding: 12px 18px 12px 48px; border: 2px solid var(--line); border-radius: 18px; outline: none; background-color: #fff; background-image: linear-gradient(45deg, transparent 45%, var(--aqua-dark) 45%, var(--aqua-dark) 55%, transparent 55%), radial-gradient(circle, transparent 45%, var(--aqua-dark) 47%, var(--aqua-dark) 57%, transparent 59%); background-position: 27px 29px, 20px 17px; background-repeat: no-repeat; background-size: 9px 9px, 15px 15px; color: var(--ink); box-shadow: 0 8px 22px rgba(23,67,74,.07); }
.fc-user-search input::placeholder, .fc-form .fc-user-search input::placeholder { color: #8a9d9f; opacity: 1; }
.fc-user-search input:focus, .fc-form .fc-user-search input:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(82,199,200,.18); }
.fc-user-card[hidden] { display: none !important; }
.fc-user-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 20px; color: var(--ink-soft); background: rgba(255,255,255,.72); text-align: center; }
.fc-user-more { display: flex; justify-content: center; padding-top: 24px; }
.fc-user-more[hidden] { display: none !important; }

body.notification-open { overflow: hidden; }
.notification-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 18px; }
.notification-modal[hidden] { display: none !important; }
.notification-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(10,44,49,.58); backdrop-filter: blur(5px); }
.notification-window { position: relative; overflow: hidden; width: min(100%, 580px); max-height: min(78vh, 720px); border: 3px solid rgba(255,255,255,.9); border-radius: 30px; background: var(--cream); box-shadow: 0 28px 80px rgba(10,44,49,.35); }
.notification-window > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--mint), #d9f1ff); }
.notification-window .fc-kicker { margin-bottom: 7px; }
.notification-window h2 { margin: 0; font-size: 30px; }
.notification-close { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--ink); font-size: 29px; line-height: 1; }
.notification-close:hover, .notification-close:focus-visible { outline: 3px solid rgba(82,199,200,.28); }
.notification-list { overflow-y: auto; max-height: calc(min(78vh, 720px) - 104px); padding: 12px; }
.notification-item { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 13px; padding: 15px 13px; border-bottom: 1px solid var(--line); border-radius: 18px; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { background: rgba(223,245,223,.72); }
.notification-avatar { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 17px; background: #fff; box-shadow: 0 5px 16px rgba(23,67,74,.09); font-size: 23px; }
.notification-copy { min-width: 0; }
.notification-copy p { margin: 0 0 3px; color: var(--ink); font-weight: 900; line-height: 1.35; }
.notification-copy time { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.notification-link { display: inline-block; margin-top: 7px; font-size: 13px; font-weight: 1000; }
.notification-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 11px; color: #267c4b; font-size: 13px; font-weight: 1000; }
.notification-decline { padding: 7px 3px; border: 0; background: transparent; color: var(--ink-soft); font-weight: 900; text-decoration: underline; }
.notification-empty { padding: 48px 20px; color: var(--ink-soft); text-align: center; }
.notification-empty.error { color: #8b3227; }
.friends-window { width: min(100%, 780px); }
.friends-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; overflow-y: auto; max-height: calc(min(78vh, 720px) - 104px); padding: 14px; }
.friend-card { display: grid; grid-template-columns: 56px minmax(0,1fr); align-items: center; gap: 11px; min-width: 0; padding: 15px; border: 2px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 7px 20px rgba(23,67,74,.07); }
.friend-card.is-accepted { border-color: #8dd8c4; background: #f4fffb; }
.friend-card.is-outgoing { border-color: #eed27c; background: #fffaf0; }
.friend-card.is-incoming { border-color: #ef9e91; background: #fff3ef; }
.friend-card .fc-avatar { width: 56px; height: 56px; font-size: 20px; }
.friend-card-copy { min-width: 0; }
.friend-card-copy strong, .friend-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-card-copy strong { font-size: 17px; }
.friend-card-copy small { color: var(--ink-soft); font-size: 12px; }
.friend-card-copy small.online { color: #267c4b; font-weight: 900; }
.friend-status { grid-column: 1 / -1; justify-self: start; padding: 5px 9px; border-radius: 999px; background: #e8f2ee; color: var(--ink-soft); font-size: 11px; font-weight: 1000; text-transform: uppercase; letter-spacing: .04em; }
.is-accepted .friend-status { background: var(--mint); color: #267c4b; }
.is-outgoing .friend-status { background: #fff0b8; color: #775d12; }
.is-incoming .friend-status { background: #ffdcd5; color: #923b30; }
.friend-card-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 37px; padding-top: 10px; border-top: 1px solid rgba(23,67,74,.12); font-size: 13px; font-weight: 1000; }
.friend-card-actions a { color: var(--aqua-dark); }
.friends-empty { grid-column: 1 / -1; padding: 50px 20px; color: var(--ink-soft); text-align: center; }
.friends-empty p { margin: 0 0 15px; }

.fc-form { display: grid; gap: 16px; }
.fc-form label { display: grid; gap: 6px; font-weight: 900; }
.fc-form input, .fc-form textarea, .fc-form select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); }
.fc-form input:focus, .fc-form textarea:focus, .fc-form select:focus { outline: 3px solid rgba(82,199,200,.22); border-color: var(--aqua); }
.fc-alert { padding: 13px 16px; margin: 0 0 18px; border-radius: 15px; background: var(--mint); font-weight: 800; }
.fc-alert.error { background: #ffe3de; color: #8b3227; }
.auth-scene {
  position: relative;
  display: grid;
  min-height: calc(100vh - 132px);
  place-items: center;
  padding: 54px 0;
  overflow: hidden;
  background-image: linear-gradient(105deg, rgba(23,67,74,.42), rgba(17,114,123,.13)), var(--auth-backdrop);
  background-position: center;
  background-size: cover;
}
.auth-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,250,240,.08), rgba(255,250,240,.32));
  pointer-events: none;
}
.auth-scene-inner { position: relative; z-index: 1; display: flex; justify-content: center; }
.auth-window {
  width: min(100%, 540px);
  padding: clamp(26px, 5vw, 44px);
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 34px;
  background: rgba(255,250,240,.96);
  box-shadow: 0 28px 80px rgba(12,53,58,.28);
  backdrop-filter: blur(16px);
}
.auth-window-wide { width: min(100%, 760px); }
.auth-window h1 { margin: 4px 0 10px; font-size: clamp(34px, 6vw, 50px); letter-spacing: -.04em; }
.auth-intro { margin: 0 0 24px; color: var(--ink-soft); }
.auth-icon {
  float: right;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 24px;
  background: var(--yellow);
  box-shadow: 0 7px 0 rgba(183,145,38,.15);
  font-size: 32px;
  transform: rotate(4deg);
}
.auth-window .fc-form { clear: both; }
.auth-submit { width: 100%; margin-top: 2px; }
.auth-check { display: flex !important; grid-template-columns: 20px 1fr; align-items: start; gap: 9px !important; font-size: 14px; font-weight: 700 !important; }
.auth-check input { width: 20px !important; height: 20px; margin: 2px 0 0; accent-color: var(--aqua-dark); }
.auth-switch { margin: 24px 0 0; text-align: center; color: var(--ink-soft); }
.auth-switch a { font-weight: 1000; }
.auth-honey { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth-register-grid { grid-template-columns: 1fr 1fr; }
.auth-full { grid-column: 1 / -1; }
.optional { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.fc-form label small { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.auth-password { position: relative; display: block; }
.auth-password input { padding-right: 58px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 13px;
  background: var(--mint);
  color: var(--ink);
  font-size: 20px;
}
.password-toggle:hover, .password-toggle:focus-visible { outline: 3px solid rgba(82,199,200,.3); background: #c9eee4; }
.auth-inline-error { margin: -3px 0 0; }
.auth-inline-error[hidden] { display: none; }
.profile-grid, .pm-layout { display: grid; gap: 20px; }
.profile-summary { text-align: center; }
.profile-summary .fc-avatar { width: 92px; height: 92px; margin: 0 auto 12px; font-size: 34px; }
.profile-summary h2 { margin: 0 0 4px; }

.pm-threads { display: grid; gap: 8px; }
.pm-thread { display: flex; gap: 10px; align-items: center; padding: 11px; border-radius: 16px; color: var(--ink); text-decoration: none; }
.pm-thread:hover, .pm-thread.is-active { background: var(--mint); color: var(--ink); }
.pm-thread div { min-width: 0; }
.pm-thread strong, .pm-thread small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-thread small { color: var(--ink-soft); }
.pm-list-panel { width: min(100%, 820px); margin-inline: auto; }
.pm-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.pm-list-heading h2 { margin: 4px 0 6px; font-size: clamp(31px, 5vw, 46px); letter-spacing: -.035em; }
.pm-list-heading p { margin-bottom: 0; color: var(--ink-soft); }
.pm-list-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.pm-conversation-list { display: grid; gap: 12px; }
.pm-conversation-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 7px 22px rgba(23,67,74,.07);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pm-conversation-card:hover, .pm-conversation-card:focus-visible { color: var(--ink); border-color: var(--aqua); transform: translateY(-2px); box-shadow: var(--shadow); }
.pm-conversation-card .fc-avatar { width: 56px; height: 56px; font-size: 21px; }
.pm-conversation-copy { display: block; min-width: 0; }
.pm-conversation-copy strong, .pm-conversation-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-conversation-copy strong { margin-bottom: 3px; font-size: 18px; }
.pm-conversation-copy strong em { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 99px; background: var(--mint); color: var(--aqua-dark); font-size: 10px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.pm-conversation-copy .group-card-title { display: flex; align-items: center; gap: 7px; overflow: visible; }
.pm-conversation-copy .group-card-title em { margin-left: 0; flex: 0 0 auto; }
.pm-conversation-copy .group-card-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-conversation-copy > span { color: var(--ink-soft); font-size: 14px; }
.pm-conversation-meta { display: grid; justify-items: end; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.pm-unread { display: grid; min-width: 25px; height: 25px; padding: 0 7px; place-items: center; border-radius: 99px; background: var(--coral); color: #fff; font-weight: 1000; }
.pm-chevron { color: var(--aqua-dark); font-size: 29px; line-height: .8; }
.pm-empty { padding: 44px 24px; text-align: center; }
.pm-empty > span { font-size: 46px; }
.pm-empty h3 { margin: 8px 0; }
.pm-conversation-page { width: min(100%, 900px); margin-inline: auto; }
.conversation-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--mint);
  box-shadow: 0 8px 25px rgba(23,67,74,.08);
}
.conversation-back { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 14px; background: #fff; color: var(--aqua-dark); text-decoration: none; font-weight: 1000; }
.conversation-back:hover, .conversation-back:focus-visible { color: var(--ink); outline: 3px solid rgba(82,199,200,.25); }
.conversation-back span { font-size: 23px; }
.conversation-contact { display: flex; align-items: center; gap: 11px; min-width: 0; text-align: right; }
.conversation-contact .fc-avatar { width: 44px; height: 44px; order: 2; flex: 0 0 44px; }
.conversation-contact small { color: var(--ink-soft); font-weight: 800; }
.conversation-contact h1 { max-width: 320px; margin: 0; overflow: hidden; font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
.private-chat-shell .chat-messages { height: min(62vh, 610px); }
.fc-conversation-content { padding: 18px 0 34px; }
.group-avatar-stack { display: flex; align-items: center; width: max-content; min-width: 56px; padding-left: 4px; }
.group-avatar-stack .fc-avatar { width: 44px; height: 44px; margin-left: -20px; flex: 0 0 44px; border: 3px solid #fff; font-size: 16px; order: initial; box-shadow: 0 3px 10px rgba(23,67,74,.13); }
.group-avatar-stack .fc-avatar:first-child { margin-left: 0; }
.group-avatar-stack .fc-avatar.is-online { box-shadow: 0 0 0 2px #35b96f, 0 3px 10px rgba(23,67,74,.13); }
.group-avatar-stack .group-avatar-more { background: var(--ink); color: #fff; font-size: 12px; }
.pm-conversation-card.is-group { grid-template-columns: 92px minmax(0, 1fr) auto; }
.group-contact-title { max-width: 62%; }
.group-contact-title .group-avatar-stack { order: 2; }
.group-contact-title h1 { max-width: 300px; }
.group-builder { width: min(100%, 980px); margin-inline: auto; }
.group-builder-top { display: flex; align-items: center; gap: 24px; margin-bottom: 22px; }
.group-builder-top h2 { margin: 3px 0 0; font-size: clamp(32px,5vw,48px); }
.group-name-panel { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; margin-bottom: 26px; }
.group-count { min-width: 115px; padding: 12px 14px; border-radius: 16px; background: var(--mint); text-align: center; font-weight: 900; }
.group-count strong { font-size: 25px; }
.group-contact-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 17px; }
.group-contact-heading h3 { margin: 0 0 4px; font-size: 25px; }
.group-contact-heading p { margin: 0; color: var(--ink-soft); }
.group-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.group-contact-card { position: relative; display: flex !important; min-width: 0; min-height: 218px; flex-direction: column; align-items: center; gap: 0 !important; padding: 18px 10px 14px; border: 2px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 8px 22px rgba(23,67,74,.08); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.group-contact-card:hover { border-color: var(--aqua); transform: translateY(-1px); }
.group-contact-card.is-selected { border-color: var(--aqua-dark); background: var(--mint); }
.group-contact-card:has(input:focus-visible) { outline: 3px solid rgba(82,199,200,.3); }
.group-contact-card > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.group-contact-card .fc-avatar { width: 64px; height: 64px; margin: 0 auto 10px; flex: 0 0 64px; font-size: 24px; }
.group-contact-copy { width: 100%; min-width: 0; }
.group-contact-copy strong, .group-contact-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-contact-copy strong { margin-bottom: 2px; font-size: 17px; }
.group-contact-copy small { color: var(--ink-soft); font-size: 13px; }
.group-contact-copy small.online { color: #267c4b; font-weight: 900; }
.group-add-button { width: 100%; margin-top: auto; padding: 12px 4px 0; border-top: 1px solid var(--line); color: var(--aqua-dark); font-size: 13px; font-weight: 1000; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.is-selected .group-add-button { color: var(--ink); }
.group-mobile-submit { display: none; }

.site-footer { padding: 48px 0 28px; background: var(--ink); color: #d8ece9; }
.footer-grid { display: grid; gap: 28px; }
.site-footer a { color: #fff; }
.site-footer h2, .site-footer h3 { color: #fff; margin-top: 0; font-size: 20px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-note { padding-top: 22px; margin-top: 30px; border-top: 1px solid rgba(255,255,255,.18); font-size: 13px; color: #a8cbc5; }

@media (min-width: 700px) {
  .room-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .member-grid { grid-template-columns: repeat(4, 1fr); }
  .group-contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: 280px 1fr; align-items: start; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 960px) {
  .site-header .fc-container { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
  .header-row { flex: 0 0 auto; }
  .account-chip { display: none; }
  .account-chip.friends-toggle { display: inline-flex; }
  .app-nav { border: 0; background: transparent; }
  .app-nav-inner { display: flex; gap: 4px; }
  .app-nav a { min-width: 104px; min-height: 58px; padding: 8px 15px; flex-direction: row; gap: 8px; border-radius: 18px; font-size: 14px; }
  .nav-icon { font-size: 20px; }
  .nav-badge { top: 4px; right: 3px; left: auto; }
  .room-grid { grid-template-columns: repeat(3, 1fr); }
  .chat-layout { grid-template-columns: 260px 1fr; align-items: start; }
  .chat-sidebar { display: block; position: sticky; top: 92px; }
  .pm-layout { grid-template-columns: 300px 1fr; }
}

@media (max-width: 699px) {
  .brand-text strong { font-size: 17px; }
  .account-chip span:last-child { display: none; }
  .notification-modal { align-items: end; padding: 0; }
  .notification-window { width: 100%; max-height: 84dvh; border-width: 3px 0 0; border-radius: 28px 28px 0 0; }
  .notification-list { max-height: calc(84dvh - 98px); }
  .friends-list { grid-template-columns: 1fr; max-height: calc(84dvh - 98px); }
  .notification-window > header { padding: 18px 17px 14px; }
  .notification-window h2 { font-size: 27px; }
  .fc-hero { min-height: 620px; align-items: start; background-image: linear-gradient(180deg, rgba(255,250,240,.97) 0%, rgba(255,250,240,.88) 42%, rgba(255,250,240,.12) 72%), var(--fc-hero); background-position: 63% center; }
  .hero-copy { padding-top: 46px; }
  .hero-actions .fc-button { width: 100%; }
  .section-head { align-items: start; flex-direction: column; }
  .fc-section { padding: 52px 0; }
  .fc-content { padding-top: 26px; }
  .auth-scene { min-height: calc(100vh - 132px); padding: 24px 0; background-position: 62% center; }
  .auth-window { padding: 25px 20px; border-radius: 26px; }
  .auth-icon { width: 54px; height: 54px; border-radius: 18px; font-size: 26px; }
  .auth-register-grid { grid-template-columns: 1fr; }
  .auth-full { grid-column: auto; }
  .pm-list-heading { align-items: stretch; flex-direction: column; }
  .pm-list-actions { justify-content: flex-start; }
  .pm-list-heading .fc-button { align-self: flex-start; }
  .pm-conversation-card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; min-height: 78px; padding: 12px; border-radius: 19px; }
  .pm-conversation-card .fc-avatar { width: 48px; height: 48px; font-size: 18px; }
  .pm-conversation-meta time { display: none; }
  .pm-conversation-card.is-group { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .group-avatar-stack .fc-avatar { width: 38px; height: 38px; margin-left: -19px; flex-basis: 38px; font-size: 13px; }
  .group-contact-title { max-width: 57%; }
  .group-contact-title .group-avatar-stack { display: none; }
  .conversation-topbar { align-items: center; padding: 10px; border-radius: 18px; }
  .conversation-back { padding: 7px 10px; font-size: 13px; }
  .conversation-contact { gap: 8px; }
  .conversation-contact small { display: none; }
  .conversation-contact h1 { max-width: 125px; font-size: 17px; }
  .conversation-contact .fc-avatar { width: 38px; height: 38px; flex-basis: 38px; }
  .private-chat-shell .chat-messages { height: calc(100dvh - 330px); min-height: 360px; }
  .fc-conversation-content { padding: 12px 0 24px; }
  .group-builder-top { align-items: flex-start; flex-direction: column; gap: 14px; }
  .group-name-panel { grid-template-columns: 1fr; align-items: stretch; }
  .group-count { justify-self: start; }
  .group-contact-heading { align-items: flex-start; flex-direction: column; }
  .group-contact-heading > .fc-button { display: none; }
  .group-contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .group-contact-card { min-height: 208px; padding: 15px 8px 12px; }
  .group-contact-card .fc-avatar { width: 56px; height: 56px; flex-basis: 56px; font-size: 21px; }
  .group-add-button { font-size: 12px; }
  .group-mobile-submit { display: block; padding-top: 18px; }
  .group-mobile-submit .fc-button { width: 100%; }
}

@media (max-width: 480px) {
  .brand-text small { display: none; }
  .brand-text strong { font-size: 16px; }
  .site-brand { gap: 7px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; font-size: 22px; }
  .account-chip, .notification-toggle { width: 42px; height: 42px; flex-basis: 42px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
