/* Community UI (accounts, comments, dashboard). Uses the site's CSS variables,
 * so light and dark themes follow the site automatically. */

/* ---------- header account menu */
.ec-acct { position: relative; flex-shrink: 0; }
.ec-acct-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; max-width: 190px; padding: 0 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.ec-acct-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.ec-acct-btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.ec-acct-label { overflow: hidden; text-overflow: ellipsis; }
.ec-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--gold); color: var(--accent-contrast); font-size: 12px; font-weight: 700; line-height: 1;
}
.ec-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.ec-menu[hidden], .ec-comments [hidden] { display: none !important; }
.ec-menu-name { padding: 8px 12px 6px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-menu a, .ec-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 12px;
  border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14.5px; text-align: start; border-radius: 8px; cursor: pointer;
}
.ec-menu a:hover, .ec-menu button:hover { background: var(--surface-2); color: var(--ink); }
.ec-menu form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
/* Make room for the account button without wrapping the main menu. */
@media (max-width: 1399px) { .header-tools:has(.ec-acct) .header-search { width: 200px; } }
/* The header is already full below ~1400px: icon only there. */
@media (max-width: 1399px) {
  .ec-acct-btn { width: 40px; padding: 0; justify-content: center; position: relative; }
  .ec-acct-label { display: none; }
  .ec-acct-btn .ec-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; font-size: 11px; }
}

/* ---------- comments widget */
.ec-comments {
  margin-top: 30px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ec-c-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ec-c-title { font-size: 22px; }
.ec-count { color: var(--muted); font-size: 16px; font-weight: 500; }
.ec-c-login { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; background: var(--surface-2); border-radius: 10px; }
.ec-c-login a:not(.btn) { color: var(--accent); font-weight: 600; }
.ec-c-form { display: flex; flex-direction: column; gap: 10px; }
.ec-c-as { font-size: 14px; }
.ec-c-text {
  width: 100%; min-height: 96px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15.5px; line-height: 1.8;
}
.ec-c-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ec-c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ec-c-counter { font-size: 13px; }
.ec-c-status:not(:empty), .ec-c-formmsg:not(:empty) { margin-top: 12px; }
.ec-c-status .notice, .ec-c-formmsg .notice { margin-bottom: 0; }
.ec-c-loading { color: var(--muted); font-size: 14px; }
.ec-c-list, .ec-c-replies { list-style: none; margin: 0; padding: 0; }
.ec-c-list { margin-top: 18px; }
.ec-c-item { padding: 16px 0; border-top: 1px solid var(--line); }
.ec-c-list > .ec-c-item:first-child { border-top: 0; }
.ec-c-item.is-pending > .ec-c-body { opacity: .75; }
.ec-c-item.ec-c-target { background: var(--accent-soft); border-radius: 10px; padding-inline: 12px; }
.ec-c-replies { margin-top: 12px; margin-inline-start: 22px; padding-inline-start: 16px; border-inline-start: 2px solid var(--line); }
.ec-c-replies .ec-c-item { padding: 12px 0; }
.ec-c-replies .ec-c-item:first-child { border-top: 0; padding-top: 4px; }
.ec-c-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.ec-c-avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.ec-c-name { color: var(--ink); }
.ec-c-body { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; color: var(--ink-2); font-size: 15.5px; }
.ec-c-deleted { font-size: 14px; font-style: italic; }
.ec-c-tools { display: flex; gap: 14px; margin-top: 6px; }
.ec-c-link { border: 0; background: none; padding: 2px 0; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ec-c-link:hover { color: var(--accent); }
.ec-c-link:disabled { cursor: default; color: var(--faint); }
.ec-c-replyform { margin-top: 10px; }
.ec-c-more { margin-top: 12px; }
.ec-c-empty { padding: 10px 0; font-size: 14.5px; }
.ec-c-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; }
.ec-c-foot a { text-decoration: underline; }
@media (max-width: 640px) {
  .ec-comments { padding: 18px 16px; }
  .ec-c-replies { margin-inline-start: 6px; padding-inline-start: 12px; }
}

/* ---------- member pages */
.ec-page { max-width: 980px; }
.ec-page.ec-wide { max-width: var(--container); }
.ec-card-title { font-size: 26px; margin-bottom: 6px; }
.ec-card .hint { margin-bottom: 18px; }
.ec-form { display: flex; flex-direction: column; gap: 14px; }
.ec-form .form-actions { margin-top: 4px; }
.ec-link { color: var(--accent); font-size: 14px; font-weight: 600; }
.ec-alt { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.ec-alt a, .ec-agree a, .ec-prose a, .ec-small a { color: var(--accent); font-weight: 600; }
.ec-agree { align-items: flex-start; line-height: 1.7; }
.ec-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ec-h1 { font-size: clamp(28px, 4vw, 38px); margin-top: 6px; }
.ec-h2 { font-size: 21px; margin-bottom: 12px; }
.ec-small { font-size: 13px; }
.ec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ec-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
@media (max-width: 760px) { .ec-grid2 { grid-template-columns: 1fr; } }
.ec-account-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.ec-mylist { list-style: none; margin: 0; padding: 0; }
.ec-mylist li { padding: 12px 0; border-top: 1px solid var(--line); }
.ec-mylist li:first-child { border-top: 0; }
.ec-mymeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.ec-mymeta a { color: var(--accent); font-weight: 600; }
.ec-body { margin-top: 6px; line-height: 1.85; overflow-wrap: anywhere; color: var(--ink-2); }
.ec-danger-zone summary { cursor: pointer; font-weight: 700; color: var(--danger); }
.ec-danger-zone[open] summary { margin-bottom: 10px; }
.ec-prose { max-width: 760px; }
.ec-prose h2 { font-size: 21px; margin: 28px 0 8px; }
.ec-prose p { line-height: 2; color: var(--ink-2); }
.ec-prose > .muted { margin-top: 10px; }

/* ---------- dashboard */
.ec-dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.ec-dash-head .tab { display: inline-flex; align-items: center; gap: 6px; }
.ec-section { margin-top: 28px; }
.ec-empty-sm { padding: 28px 16px; }
.ec-kpis { margin-bottom: 22px; }
.ec-filters .input { width: auto; min-width: 160px; height: 38px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); }
.ec-filters input[type="search"] { min-width: 240px; }
.ec-select-sm { width: auto !important; height: 34px; padding: 4px 10px !important; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); font-size: 14px; }
.ec-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.ec-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.ec-mod-card { display: flex; gap: 12px; padding: 16px 18px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ec-mod-main { flex: 1; min-width: 0; }
.ec-mod-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.ec-mod-meta a { color: var(--accent); }
.ec-mod-card .ec-body { white-space: normal; }
.ec-select { padding-top: 2px; }
.ec-select input { width: 18px; height: 18px; accent-color: var(--accent); }
.ec-mod-actions { margin-top: 12px; }
.ec-reports { margin: 10px 0 0; padding: 10px 14px; list-style: none; background: var(--danger-soft); border-radius: 10px; font-size: 14px; }
.ec-reports li + li { margin-top: 4px; }
.ec-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.ec-users td { vertical-align: top; }
.ec-narrow { max-width: 420px; }
.ec-form .check { line-height: 1.7; }
.seg a.seg-s, .seg a[aria-current] { background: var(--accent); color: var(--accent-contrast); }

/* daily chart */
.ec-chart { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); align-items: end; gap: 2px; height: 220px; padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.ec-bar { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.ec-bar span { position: absolute; bottom: 0; border-radius: 3px 3px 0 0; }
.ec-bar-v { width: 100%; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.ec-bar-u { width: 55%; background: var(--accent); }
.ec-bar:hover .ec-bar-v { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.ec-bar i { position: absolute; bottom: -20px; font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; direction: ltr; }
.ec-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-inline: 8px 4px; }
.ec-key-v { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.ec-key-u { background: var(--accent); }
.ec-ranked { list-style: none; margin: 0; padding: 0; }
.ec-ranked li { position: relative; padding: 8px 10px; margin-bottom: 4px; border-radius: 8px; overflow: hidden; }
.ec-ranked-row { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.ec-ranked-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-ranked-label a { color: var(--ink); }
.ec-ranked-label a:hover { color: var(--accent); }
.ec-ranked-bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent-soft); border-radius: 8px; }
