
:root{
  --swsocial-accent:#d62828;
  --swsocial-accent-rgb:214,40,40;
  --swsocial-accent-dark:#b71f1f;
  --swsocial-accent-soft:#fff1f1;
  --swsocial-text:#111827;
  --swsocial-surface:#fff;
  --swsocial-border:#eee;
}

.swusers-box{background:var(--swsocial-surface);border:1px solid var(--swsocial-border);border-radius:16px;padding:16px;margin:0 0 16px 0;color:var(--swsocial-text);}
.swusers-form input[type="text"],.swusers-form input[type="url"],.swusers-form input[type="number"],.swusers-form textarea{padding:10px;border-radius:12px;border:1px solid var(--swsocial-border);max-width:100%;}
.swusers-form input[type="password"],
.swusers-form input[type="email"]{padding:10px;border-radius:12px;border:1px solid var(--swsocial-border);max-width:100%;}

.swusers-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px 0;}
.swusers-tabs a{display:inline-block;padding:8px 12px;border-radius:999px;border:1px solid var(--swsocial-border);text-decoration:none;}
.swusers-tabs a.is-active{background:var(--swsocial-accent);color:#fff;border-color:var(--swsocial-accent);}

.swusers-image-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap;}
.swusers-image-row img{border-radius:16px;border:1px solid var(--swsocial-border);background:var(--swsocial-surface);}
.swusers-image-row img.avatar{border-radius:999px;}

/* Switch (toggle) */
.swusers-switch{display:inline-flex;align-items:center;gap:10px;}
.swusers-switch input{display:none;}
.swusers-switch .track{width:44px;height:24px;border-radius:999px;background:var(--swsocial-border);position:relative;transition:.2s;}
.swusers-switch .thumb{width:20px;height:20px;border-radius:999px;background:#fff;position:absolute;top:2px;left:2px;transition:.2s;box-shadow:0 2px 8px rgba(0,0,0,.12);}
.swusers-switch input:checked + .track{background:var(--swsocial-accent);}
.swusers-switch input:checked + .track .thumb{left:22px;}
.swusers-muted{color:#666;font-size:13px;}
.swusers-grid{display:grid;grid-template-columns:280px 1fr;gap:16px;}
@media (max-width:900px){.swusers-grid{grid-template-columns:1fr;}}
.swusers-card{border:1px solid var(--swsocial-border);border-radius:16px;padding:12px;background:var(--swsocial-surface);display:flex;gap:12px;align-items:center;color:var(--swsocial-text);}
.swusers-card .meta{min-width:0;}
.swusers-card .name{font-weight:700;margin:0;}
.swusers-card .sub{margin:2px 0 0 0;color:#666;font-size:13px;}
.swusers-card img{width:56px;height:56px;border-radius:999px;object-fit:cover;border:1px solid var(--swsocial-border);background:var(--swsocial-surface);}
.swusers-members-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;}
@media (max-width:900px){.swusers-members-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:520px){.swusers-members-grid{grid-template-columns:1fr;}}
.swusers-filters a{display:inline-block;margin:0 8px 8px 0;padding:6px 10px;border:1px solid var(--swsocial-border);border-radius:999px;text-decoration:none;}
.swusers-filters a.is-active{background:var(--swsocial-accent);color:#fff;border-color:var(--swsocial-accent);}

/* Auth */
.swusers-auth-card{
  max-width:560px;
  margin:0 auto 24px;
  padding:28px 26px;
  border-radius:28px;
  box-shadow:0 14px 36px rgba(17,24,39,.05);
}

.swusers-auth-card__title{
  margin:0 0 18px;
  font-size:clamp(2rem,4vw,3rem);
  line-height:1.05;
  font-weight:800;
  color:var(--swsocial-text);
}

.swusers-auth-form{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.swusers-auth-field{
  margin:0;
}

.swusers-auth-field label{
  display:block;
  margin:0 0 8px;
  color:var(--swsocial-text);
  font-size:1rem;
  font-weight:600;
}

.swusers-auth-help{
  display:block;
  margin-top:10px;
  color:#4b5563;
  font-size:.98rem;
  line-height:1.45;
}

.swusers-auth-form input[type="text"],
.swusers-auth-form input[type="password"],
.swusers-auth-form input[type="email"]{
  width:100%;
  min-height:58px;
  padding:16px 20px;
  border:1px solid var(--swsocial-border);
  border-radius:22px;
  background:var(--swsocial-surface);
  font-size:1.05rem;
  color:var(--swsocial-text);
  transition:border-color .2s ease, box-shadow .2s ease;
}

.swusers-auth-form input[type="text"]:focus,
.swusers-auth-form input[type="password"]:focus,
.swusers-auth-form input[type="email"]:focus{
  outline:none;
  border-color:var(--swsocial-accent);
  box-shadow:0 0 0 4px rgba(var(--swsocial-accent-rgb),.12);
}

.swusers-auth-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-top:-4px;
}

.swusers-auth-row--stack{
  justify-content:flex-start;
}

.swusers-auth-check{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--swsocial-text);
  font-weight:500;
  cursor:pointer;
}

.swusers-auth-check input{
  width:18px;
  height:18px;
  margin:0;
  accent-color:var(--swsocial-accent);
}

.swusers-auth-submit{
  margin:4px 0 0;
}

.swusers-auth-submit .button.button-primary{
  width:100%;
  min-height:54px;
  padding:14px 22px;
  border:none;
  border-radius:999px;
  background:var(--swsocial-accent);
  color:#fff;
  font-size:1.1rem;
  font-weight:700;
  text-align:center;
}

.swusers-auth-submit .button.button-primary:hover,
.swusers-auth-submit .button.button-primary:focus{
  background:var(--swsocial-accent-dark);
  color:#fff;
}

.swusers-auth-link{
  color:var(--swsocial-accent);
  font-weight:600;
  text-decoration:none;
}

.swusers-auth-link:hover,
.swusers-auth-link:focus{
  color:var(--swsocial-accent-dark);
  text-decoration:underline;
}

.swusers-auth-link--muted{
  color:var(--swsocial-text);
  font-weight:600;
}

.swusers-auth-footer{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid #eceff3;
}

.swusers-auth-card > p:last-child{
  margin:18px 0 0;
  padding-top:18px;
  border-top:1px solid #eceff3;
}

.swusers-auth-card > p:last-child a{
  color:var(--swsocial-accent);
  font-weight:600;
  text-decoration:none;
}

.swusers-auth-card > p:last-child a:hover,
.swusers-auth-card > p:last-child a:focus{
  color:var(--swsocial-accent-dark);
  text-decoration:underline;
}

/* Header account menu */
.swsocial-account-menu,
.swsocial-account-menu:visited{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  flex-direction:row !important;
  flex-wrap:nowrap;
  gap:10px;
  position:relative;
  min-width:148px;
  max-width:100%;
  text-decoration:none !important;
  color:var(--swsocial-text) !important;
  font-weight:700;
  line-height:1.2;
  vertical-align:middle;
}

.swsocial-account-menu:hover,
.swsocial-account-menu:focus,
.swsocial-account-menu:active{
  color:var(--swsocial-text) !important;
  text-decoration:none !important;
}

.swsocial-account-menu__avatar{
  flex:0 0 auto;
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  overflow:hidden;
  line-height:1;
  background:#f3f4f6;
  color:var(--swsocial-text);
}

.swsocial-account-menu__avatar img,
.swsocial-account-menu__avatar-image{
  display:block;
  width:32px;
  height:32px;
  border-radius:999px !important;
  object-fit:cover;
}

.swsocial-account-menu__avatar--placeholder{
  border:1px solid var(--swsocial-border);
  background:var(--swsocial-surface);
  color:var(--swsocial-text) !important;
}

.swsocial-account-menu__icon{
  width:18px;
  height:18px;
  display:block;
  flex:0 0 auto;
  color:inherit !important;
  fill:currentColor;
}

.swsocial-account-menu__name{
  display:block;
  color:var(--swsocial-text) !important;
  font-weight:700;
  white-space:nowrap;
}

.swsocial-account-menu--guest{
  min-width:132px;
}

.swsocial-account-menu--guest .swsocial-account-menu__avatar{
  border-color:var(--swsocial-border);
  background:var(--swsocial-surface);
  color:var(--swsocial-text) !important;
}

.swsocial-account-menu--guest .swsocial-account-menu__name{
  font-size:14px;
  line-height:1;
}

.swsocial-account-menu__badge{
  position:absolute;
  top:-8px;
  right:-10px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:var(--swsocial-accent);
  color:#fff;
  font-size:11px;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

@media (max-width:767px){
  .swusers-auth-card{
    padding:22px 18px;
    border-radius:22px;
  }

  .swusers-auth-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .swsocial-account-menu{
    min-width:auto;
  }
}

.swusers-pill.is-active{background:var(--swsocial-accent);color:#fff !important;border-color:var(--swsocial-accent) !important;}

/* -------------------------------------------------------------------------- */
/* Messages */
/* -------------------------------------------------------------------------- */

.swusers-messages{display:grid;grid-template-columns:320px 1fr;gap:14px;}
.swusers-msg-threads{border:1px solid var(--swsocial-border);border-radius:14px;overflow:hidden;}
.swusers-msg-threadlink{display:flex;gap:10px;align-items:center;padding:12px 12px;border-bottom:1px solid var(--swsocial-border);text-decoration:none;}
.swusers-msg-threadlink.is-active{background:var(--swsocial-accent-soft);}

.swusers-msg-thread{border:1px solid var(--swsocial-border);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;min-height:420px;}
.swusers-msg-header{padding:12px 14px;border-bottom:1px solid var(--swsocial-border);display:flex;align-items:center;gap:10px;}
.swusers-msg-back{display:none;text-decoration:none;border:1px solid var(--swsocial-border);border-radius:999px;padding:4px 10px;line-height:1;}
.swusers-msg-scroll{padding:14px;flex:1;overflow:auto;max-height:70vh;}
.swusers-msg-bubble{display:flex;flex-direction:column;max-width:78%;padding:10px 12px;border:1px solid var(--swsocial-border);border-radius:14px;margin-bottom:10px;}
.swusers-msg-bubble.is-me{margin-left:auto;background:var(--swsocial-surface);}
.swusers-msg-bubble.is-them{margin-right:auto;background:var(--swsocial-accent-soft);}
.swusers-msg-reply{padding:12px;border-top:1px solid var(--swsocial-border);}
.swusers-msg-form textarea{width:100%;border-radius:12px;border:1px solid var(--swsocial-border);padding:10px;}
.swusers-msg-actions{display:flex;justify-content:flex-end;margin-top:8px;}

/* Mobile: une seule colonne (liste OU discussion) */
@media (max-width:900px){
  .swusers-messages{grid-template-columns:1fr;}
  .swusers-messages.has-thread .swusers-msg-threads{display:none;}
  .swusers-msg-back{display:inline-flex;align-items:center;}
}


/* Tabs badge (unread) */
.swusers-tab-badge{
  display:none;
  margin-left:6px;
  background:var(--swsocial-accent);
  color:#fff;
  font-size:12px;
  line-height:1;
  padding:2px 8px;
  border-radius:999px;
}

/* Messages body/meta helpers */
.swusers-msg-body p{margin:0 0 8px 0;}
.swusers-msg-body p:last-child{margin-bottom:0;}
.swusers-msg-meta{font-size:11px;margin-top:6px;}
