/* Community dashboard, «Ζεστό Φως» (warm light). Scoped to this page only. */
:root { --cm-bg:#FFFDF8; --cm-surface:#FFFFFF; --cm-raised:#FBF5EC; --cm-line:#EDE4D8; --cm-text:#25211E; --cm-muted:#6E655C; --cm-accent:#B8501A; --cm-warm:#C9634A; }
body.community-page { background:var(--cm-bg); color:var(--cm-text); }
body.community-page header, body.community-page .top { background:var(--cm-bg); }
body.community-page header .logo, body.community-page .logo { color:var(--cm-text); }
body.community-page footer { background:var(--cm-bg); color:var(--cm-muted); border-color:var(--cm-line); }
body.community-page footer a { color:var(--cm-accent); }

.cm-app { display:grid; grid-template-columns:240px minmax(0,1fr); gap:16px; max-width:1200px; margin:0 auto; padding:24px 16px 120px; align-items:start; }
.cm-main { display:grid; gap:10px; min-width:0; }
.cm-side { display:grid; gap:10px; position:sticky; top:24px; }

.card { background:var(--cm-surface); border:1px solid var(--cm-line); border-radius:24px; padding:18px 20px; box-shadow:0 18px 40px -32px rgba(126,45,10,.35); color:var(--cm-text); }
.cm-kicker { font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color:var(--cm-muted); font-weight:800; }
h1 { margin:6px 0 0; font-size:1.7rem; color:var(--cm-text); letter-spacing:-.02em; }
h2 { margin:0 0 8px; font-size:1.1rem; color:var(--cm-text); }
h3 { margin:14px 0 8px; font-size:.9rem; color:var(--cm-muted); }
.cm-muted { color:var(--cm-muted); font-size:.9rem; line-height:1.45; margin:0 0 8px; }

.cm-head { display:flex; justify-content:space-between; align-items:flex-end; gap:8px; flex-wrap:wrap; }
.cm-head--tight { margin-bottom:12px; }
.cm-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.cm-row--end { justify-content:flex-end; margin-top:12px; }

/* Sidebar */
.cm-profile { display:flex; gap:14px; align-items:center; }
.cm-profile-meta { min-width:0; display:grid; gap:6px; }
.cm-handle { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-weight:800; color:var(--cm-text); font-size:1rem; overflow-wrap:anywhere; }
.cm-avatar { flex:0 0 auto; width:42px; height:42px; border-radius:50%; display:grid; place-items:center; font-weight:800; font-size:.8rem; color:var(--cm-bg); background:var(--cm-accent); }
.cm-avatar--lg { width:52px; height:52px; font-size:.95rem; background:var(--cm-warm); }
.cm-nav { display:grid; gap:2px; background:var(--cm-surface); border:1px solid var(--cm-line); border-radius:24px; padding:8px; }
.cm-nav a { color:var(--cm-muted); text-decoration:none; padding:10px 14px; border-radius:999px; font-weight:700; font-size:.95rem; }
.cm-nav a:hover, .cm-nav a:focus-visible { background:var(--nx-community, #FBE1DC); color:var(--cm-text); outline:none; }
.cm-note { display:grid; gap:6px; font-size:.88rem; color:var(--cm-muted); line-height:1.5; }
.cm-note strong { color:var(--cm-text); }

/* Buttons */
.cm-btn { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 16px; border-radius:12px; font:inherit; font-weight:800; font-size:.9rem; cursor:pointer; border:1px solid transparent; text-decoration:none; white-space:nowrap; }
.cm-btn--accent { background:var(--cm-accent); color:var(--cm-bg); }
.cm-btn--accent:hover { filter:brightness(1.08); }
.cm-btn--ghost { background:transparent; color:var(--cm-text); border-color:var(--cm-line); }
.cm-btn--ghost:hover { background:var(--cm-raised); }
.cm-btn--small { min-height:32px; padding:0 12px; font-size:.8rem; border-radius:10px; }
.cm-btn:focus-visible, .cm-nav a:focus-visible { outline:2px solid var(--cm-accent); outline-offset:2px; }

/* Stats */
.cm-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.cm-stat { display:grid; gap:4px; padding:12px 14px; }
.cm-stat strong { font-size:1.9rem; color:var(--cm-text); line-height:1; }

/* Inputs */
.community-page input[type="text"] { flex:1 1 220px; min-width:0; min-height:44px; padding:10px 14px; border-radius:999px; border:1px solid var(--cm-line); background:#fff; color:var(--cm-text); font:inherit; font-size:15px; }
.community-page input[type="text"]::placeholder { color:#9A8F84; }
.community-page input[type="text"]:focus { outline:2px solid var(--cm-accent); outline-offset:1px; border-color:transparent; }
.community-page input[readonly] { color:var(--cm-muted); }
#claimBlock form, #addFriendForm { margin-top:4px; }

/* Message */
.cm-message { margin:0; color:var(--cm-muted); font-size:.9rem; min-height:0; }
.cm-message:empty { display:none; }
.cm-message.is-error { color:#B3261E; }

/* Friend rows (table-like) and team cards share .community-item */
.cm-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.community-item { display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--cm-line); border-radius:18px; background:var(--cm-raised); }
.community-item[draggable="true"] { cursor:grab; }
.community-item.is-selected { border-color:var(--cm-accent); box-shadow:inset 3px 0 0 var(--cm-accent); }
.community-avatar { flex:0 0 auto; width:40px; height:40px; border-radius:50%; display:grid; place-items:center; font-weight:800; font-size:.8rem; color:var(--cm-bg); background:var(--cm-accent); }
.community-item:nth-child(3n+2) .community-avatar { background:var(--cm-warm); }
.community-item:nth-child(3n) .community-avatar { background:var(--cm-line); color:var(--cm-text); }
.community-meta { flex:1 1 auto; min-width:0; }
.community-name { font-weight:700; color:var(--cm-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.community-sub { color:var(--cm-muted); font-size:.84rem; overflow-wrap:anywhere; margin-top:2px; }
.community-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.community-actions .cm-btn { min-height:32px; padding:0 12px; font-size:.8rem; border-radius:10px; }
.cm-list > li.community-muted { background:none; border:0; color:var(--cm-muted); font-size:.92rem; padding:6px 2px; }

/* Team composer */
.cm-composer { display:grid; gap:8px; }
#teamForm { display:grid; gap:8px; }
#teamForm[hidden] { display:none; }
#teamForm-wrap:has(#teamForm[hidden]) { display:none; }
.cm-drop { min-height:64px; border:2px dashed var(--cm-line); border-radius:14px; padding:10px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; color:var(--cm-muted); font-size:.9rem; }
.cm-drop::before { content:attr(data-el); }
.cm-drop.is-over { border-color:var(--cm-accent); background:rgba(251,225,220,.45); }
#teamSelected { min-height:0; }
#teamSelected:empty::before { content:"Σύρε φίλους εδώ ή πάτα «Στην ομάδα»."; color:var(--cm-muted); font-size:.88rem; }
.community-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; background:var(--cm-raised); border:1px solid var(--cm-line); color:var(--cm-text); font-size:.86rem; font-weight:700; }
.community-chip--remove { cursor:pointer; }
.community-chip--remove::after { content:"×"; font-weight:800; color:var(--cm-warm); margin-left:2px; }

/* Team cards */
.cm-cards { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:8px; }
.cm-cards .community-item { flex-direction:column; align-items:flex-start; gap:8px; padding:12px; min-height:112px; }
.cm-cards .community-item .community-meta { width:100%; }
.cm-cards .community-item .cm-btn { margin-top:auto; align-self:flex-start; }
.cm-cards .community-item:nth-child(3n+1) { background:var(--cm-raised); }
.cm-cards .community-item:nth-child(3n+2) { background:var(--cm-raised); }

/* Team view and chat */
#teamView { display:grid; gap:8px; }
#teamView[hidden] { display:none; }
#memberList { gap:6px; }
.community-chip--static { cursor:default; }
.cm-chat { display:grid; gap:8px; margin-top:4px; }
.cm-messages { max-height:52vh; min-height:160px; overflow-y:auto; display:grid; gap:6px; padding:10px; border-radius:14px; background:var(--cm-bg); border:1px solid var(--cm-line); }
.community-msg { padding:10px 12px; border-radius:14px; background:var(--cm-raised); max-width:86%; }
.community-msg.is-mine { justify-self:end; background:var(--nx-community, #FBE1DC); }
.community-msg-head { display:flex; justify-content:space-between; gap:10px; font-size:.76rem; color:var(--cm-muted); font-weight:700; }
.community-msg-body { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--cm-text); margin-top:4px; line-height:1.45; }
.community-msg-report { background:none; border:0; color:var(--cm-muted); font-size:.75rem; padding:4px 0 0; cursor:pointer; text-decoration:underline; }
#inviteOut { display:grid; gap:8px; }
#inviteOut input { width:100%; }
[hidden] { display:none !important; }

/* Tablet and phone */
@media (max-width: 860px) {
  .cm-app { grid-template-columns:1fr; padding:16px 14px 120px; }
  .cm-side { position:static; grid-template-columns:1fr; }
  .cm-nav { grid-template-columns:repeat(3,1fr); }
}
@media (max-width: 520px) {
  .card { padding:16px; border-radius:20px; }
  .cm-stats { grid-template-columns:repeat(3,1fr); gap:8px; }
  .cm-stat { padding:12px; }
  .cm-stat strong { font-size:1.4rem; }
  .cm-row > input[type="text"] { flex-basis:100%; }
  .community-item { flex-wrap:wrap; }
  .community-item .community-actions { width:100%; padding-left:52px; justify-content:flex-start; }
  .cm-cards { grid-template-columns:1fr; }
  .cm-msg, .community-msg { max-width:100%; }
  .cm-head { align-items:flex-start; }
}

/* Contrast fixes: the site's global heading, link and button rules were winning on this page. */
.cm-app h1, .cm-app h2, .cm-app h3, .cm-app strong { color: var(--cm-text) !important; }
.cm-app .cm-stat strong { color: var(--cm-text) !important; }
.cm-app .cm-kicker, .cm-app .cm-muted, .cm-app .cm-note, .cm-app .community-sub { color: var(--cm-muted) !important; }
.cm-app .cm-btn--ghost, .community-page .cm-btn--ghost { background: transparent !important; color: var(--cm-text) !important; border: 1px solid var(--cm-line) !important; }
.cm-app .cm-btn--accent, .community-page .cm-btn--accent { background: var(--cm-accent) !important; color: var(--cm-bg) !important; border: 0 !important; }
.cm-app .cm-nav a { color: var(--cm-muted) !important; }
.cm-app .cm-nav a:hover { color: var(--cm-text) !important; }
body.community-page header .logo, body.community-page .top .logo, body.community-page .logo { color: var(--cm-text) !important; }
body.community-page header .account-btn, body.community-page header a.account-btn { color: var(--cm-bg) !important; background: var(--cm-text) !important; }

/* Backgrounds: the site's global card and body rules were overriding the dark surfaces. */
html, body.community-page { background: var(--cm-bg) !important; }
.cm-app .card, .community-page .card { background: var(--cm-surface) !important; border: 1px solid var(--cm-line) !important; color: var(--cm-text) !important; }
.cm-app .cm-profile, .cm-app .cm-note { background: var(--cm-surface) !important; }
.cm-app .community-item { background: var(--cm-raised) !important; }
.cm-app .cm-drop, .community-page .cm-drop { background: transparent !important; }

/* Inputs and header edges: keep them in the dark palette. */
.community-page input[type="text"] { background: var(--cm-bg) !important; color: var(--cm-text) !important; border: 1px solid var(--cm-line) !important; }
body.community-page header, body.community-page .wrap.top, body.community-page header .wrap { background: var(--cm-bg) !important; }

/* Sidebar must not spill into the main column; header edges take the dark background. */
@media (min-width: 861px) { .cm-app { grid-template-columns:minmax(0,240px) minmax(0,1fr); } }
.cm-side > * { min-width:0; }
.cm-main, .cm-main > * { min-width:0; max-width:100%; }
.cm-profile { flex-wrap:wrap; }
.cm-profile-meta { flex:1 1 130px; min-width:0; }
.cm-profile .cm-row { gap:6px; }
body.community-page header, body.community-page header > *, body.community-page .wrap { background: var(--cm-bg) !important; }
.cm-profile .cm-row { flex-direction:column; align-items:stretch; }
.cm-profile .cm-btn { white-space:normal; width:100%; }
body.community-page > header { background: var(--cm-bg) !important; }

/* Community page has its own navigation; keep the bottom section dock out of the way. */
body.community-page .wc-dock { display: none !important; }
body.community-page.wc-has-dock { padding-bottom: calc(24px + var(--wc-launcher-clearance, 56px) + env(safe-area-inset-bottom, 0px)) !important; }

/* Welcome copy, first steps and the sign-in gate (signed-out visitors). */
.cm-hero { align-items:flex-start; }
.cm-hero__copy { min-width:0; flex:1 1 320px; }
.cm-lead { margin:6px 0 10px; color:var(--cm-muted); font-size:1rem; line-height:1.55; max-width:52ch; }
.cm-steps { display:flex; flex-wrap:wrap; gap:6px 14px; margin:0; padding:0; list-style:none; font-size:.9rem; font-weight:700; color:var(--cm-text); }
.cm-steps li { display:inline-flex; align-items:center; gap:6px; }
.cm-steps b { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#FBE1DC; color:#9a3f12; font-size:.78rem; }
.cm-steps__label { color:var(--cm-muted); }
.cm-steps li:first-child { flex-basis:100%; }
.cm-gate { text-align:center; padding:28px 22px !important; }
.cm-gate__art { width:min(220px,70%); height:auto; display:block; margin:0 auto 8px; }
.cm-gate h2 { font-size:1.25rem; margin:0 0 6px; }
.cm-gate .cm-btn { min-height:46px; padding:0 22px; }
[hidden] { display:none !important; }
/* Header sign-in stays visible on phones on this page (it was hidden by the shared phone rules). */
@media (max-width: 767px) {
  html body.community-page header #communityAccountBtn { display:inline-flex !important; align-items:center; min-height:40px !important; padding:0 10px !important; border-radius:999px; font-size:.78rem !important; font-weight:800; white-space:nowrap; text-decoration:none; }
}
.cm-app:has(> .cm-side[hidden]) { grid-template-columns:minmax(0,1fr) !important; max-width:820px; }

/* «Ζεστό Φως»: warm-light paper, tinted page head, one primary button style (no navy). */
:root { --cm-bg:#FFFDF8; --cm-surface:#FFFFFF; --cm-raised:#FBF6EF; --cm-line:#EDE4D8; --cm-text:#25211E; --cm-muted:#716960; --cm-accent:#B8501A; --cm-warm:#9a3f12; }
.cm-hero { position:relative; padding:28px 28px 24px; border-radius:28px; background:var(--nx-community, #FBE1DC); overflow:hidden; margin-bottom:16px; align-items:center; }
.cm-hero h1 { font-size:clamp(2rem,4.2vw,3.1rem); line-height:1.02; letter-spacing:-.05em; font-weight:900; margin:6px 0 6px; }
.cm-hero h1 em { font-family:Literata, Georgia, serif; font-style:italic; font-weight:500; color:var(--cm-accent) !important; letter-spacing:-.02em; }
.cm-hero .cm-kicker { display:inline-flex; align-items:center; gap:10px; font-size:.74rem; font-weight:900; letter-spacing:.16em; text-transform:uppercase; color:var(--cm-accent) !important; }
.cm-hero .cm-kicker::before { content:""; width:26px; height:2px; border-radius:2px; background:var(--nx-sun, #F08A24); }
.cm-hero .cm-lead { color:#5a5148 !important; }
.cm-hero__art { width:130px; height:auto; flex:0 0 auto; }
.cm-steps b { background:var(--cm-accent); color:#fff; }
.cm-app .cm-btn--accent, .community-page .cm-btn--accent { background:var(--cm-accent) !important; color:#fff !important; border-radius:999px !important; box-shadow:0 12px 22px -14px rgba(126,45,10,.75); }
.cm-app .cm-btn--ghost, .community-page .cm-btn--ghost { border-radius:999px !important; background:#fff !important; }
.cm-btn { border-radius:999px; }
.cm-app .card, .community-page .card { border-radius:22px; }
body.community-page header #communityAccountBtn, body.community-page header a.account-btn { background:var(--cm-accent) !important; color:#fff !important; border-radius:999px; }
body.community-page .logo .dot { background:#F08A24 !important; }
@media (max-width: 520px) { .cm-hero { padding:22px 18px 18px; border-radius:22px; } .cm-hero__art { display:none; } }
body.community-page header.cm-hero { background:var(--nx-community, #FBE1DC) !important; border:0 !important; }
body.community-page header.cm-hero > * { background:transparent !important; }
