/* Robotopian Community – storefront styles. Inherits the theme's font and
   colours; merchants tune accent / radius via the "Community forum styles"
   app embed (CSS variables --rc-accent, --rc-radius). */
.rc-forum {
  --rc-accent-fallback: #111;
  --rc-border: rgba(0, 0, 0, 0.12);
  --rc-muted: rgba(0, 0, 0, 0.6);
  --rc-bg-soft: rgba(0, 0, 0, 0.035);
  --rc-r: var(--rc-radius, 8px);
  --rc-a: var(--rc-accent, var(--rc-accent-fallback));
  --rc-on-a: var(--rc-accent-contrast, #fff);
  --rc-s: var(--rc-space, 1);
  max-width: var(--rc-max-width, 1100px);
  margin: 0 auto;
  padding: calc(1.5 * var(--rc-fs) * var(--rc-s)) calc(1 * var(--rc-fs)) calc(3 * var(--rc-fs) * var(--rc-s));
  line-height: 1.5;
  box-sizing: border-box;
  /* Base unit. Every font size and spacing below is calc(n * --rc-fs) rather than rem because
     themes such as Dawn/Sense set html { font-size: 62.5% }, which would shrink every rem value. */
  --rc-fs: var(--rc-font-size, 16px);
  font-size: var(--rc-fs);
  font-family: var(--rc-font, inherit);
}
.rc-forum *, .rc-forum *::before, .rc-forum *::after { box-sizing: border-box; }
/* Themes (e.g. Dawn) add an outline + box-shadow ring to every :focus-visible
   element. Neutralise it inside the forum and use our own focus styles. */
.rc-forum :focus, .rc-forum :focus-visible, .rc-forum .rc-editor__content.ProseMirror-focused { outline: none !important; box-shadow: none !important; }
.rc-forum .rc-btn:focus-visible, .rc-forum .rc-like:focus-visible, .rc-forum .rc-tab:focus-visible, .rc-forum .rc-editor__btn:focus-visible, .rc-forum .rc-link:focus-visible { box-shadow: 0 0 0 2px var(--rc-a) !important; }
.rc-forum .rc-input:focus, .rc-forum .rc-search__input:focus { border-color: var(--rc-a); box-shadow: 0 0 0 1px var(--rc-a) !important; }
.rc-forum a { color: inherit; }
.rc-h1 { font-size: calc(1.75 * var(--rc-fs)); margin: 0 0 calc(0.25 * var(--rc-fs)); line-height: 1.2; }
.rc-h2 { font-size: calc(1.2 * var(--rc-fs)); margin: 0 0 calc(0.75 * var(--rc-fs)); }
.rc-lead { margin: 0 0 calc(1 * var(--rc-fs)); color: var(--rc-muted); }
.rc-muted { color: var(--rc-muted); font-size: 0.9em; }
.rc-empty { padding: calc(2 * var(--rc-fs)) calc(1 * var(--rc-fs)); text-align: center; color: var(--rc-muted); border: 1px dashed var(--rc-border); border-radius: var(--rc-r); }

/* Header */
.rc-header { display: flex; flex-wrap: wrap; gap: calc(0.75 * var(--rc-fs)); align-items: center; margin-bottom: calc(1.5 * var(--rc-fs)); padding-bottom: calc(1 * var(--rc-fs)); border-bottom: 1px solid var(--rc-border); }
.rc-header__title { font-weight: 700; font-size: calc(1.1 * var(--rc-fs)); text-decoration: none; margin-right: auto; }
.rc-search { display: flex; gap: calc(0.5 * var(--rc-fs)); flex: 1 1 260px; max-width: 420px; }
.rc-search--page { max-width: none; margin: 0 0 calc(1 * var(--rc-fs)); }
.rc-search__input, .rc-input { flex: 1; min-width: 0; padding: calc(0.55 * var(--rc-fs)) calc(0.75 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); font: inherit; background: #fff; color: inherit; }
.rc-breadcrumb { font-size: calc(0.9 * var(--rc-fs)); color: var(--rc-muted); margin-bottom: calc(1 * var(--rc-fs)); }
.rc-breadcrumb a { text-decoration: none; }
.rc-footer { margin-top: calc(3 * var(--rc-fs)); text-align: center; font-size: calc(0.8 * var(--rc-fs)); color: var(--rc-muted); }

/* Buttons */
.rc-btn { display: inline-flex; align-items: center; gap: calc(0.35 * var(--rc-fs)); padding: calc(0.55 * var(--rc-fs)) calc(1 * var(--rc-fs)); border-radius: var(--rc-r); border: 1px solid var(--rc-a); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.rc-btn--primary, .rc-forum a.rc-btn--primary { background: var(--rc-a); color: var(--rc-on-a); }
.rc-btn--secondary { background: transparent; color: inherit; border-color: var(--rc-border); }
.rc-btn:disabled, .rc-btn--busy { opacity: 0.6; cursor: progress; }
.rc-link { background: none; border: 0; padding: 0; font: inherit; color: var(--rc-muted); cursor: pointer; text-decoration: underline; }
.rc-link--danger { color: #b42318; }

/* Sections & tabs */
.rc-section { margin-bottom: calc(2 * var(--rc-fs) * var(--rc-s)); }
.rc-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: calc(0.75 * var(--rc-fs)); margin-bottom: calc(0.75 * var(--rc-fs)); }
.rc-tabs { display: flex; gap: calc(0.25 * var(--rc-fs)); flex-wrap: wrap; margin-bottom: calc(0.75 * var(--rc-fs)); }
.rc-tab { padding: calc(0.35 * var(--rc-fs)) calc(0.75 * var(--rc-fs)); border-radius: 999px; text-decoration: none; font-size: calc(0.9 * var(--rc-fs)); color: var(--rc-muted); }
.rc-tab--active, .rc-forum a.rc-tab--active { background: var(--rc-a); color: var(--rc-on-a); }

/* Category grid */
.rc-category-grid { list-style: none; margin: calc(1 * var(--rc-fs)) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: calc(0.75 * var(--rc-fs)); }
.rc-category-card { position: relative; border: 1px solid var(--rc-border); border-radius: var(--rc-r); padding: calc(1 * var(--rc-fs)); background: var(--rc-bg-soft); transition: border-color 0.15s, box-shadow 0.15s; }
.rc-category-card:hover { border-color: var(--rc-a); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
.rc-category-card:hover .rc-category-card__name { text-decoration: underline; }
.rc-category-card:focus-within { outline: 2px solid var(--rc-a); outline-offset: 2px; }
.rc-category-card__name { font-weight: 700; text-decoration: none; font-size: calc(1.05 * var(--rc-fs)); }
/* Stretch the title link over the whole card so the entire card is clickable. */
.rc-category-card__name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rc-category-card__name:focus-visible { outline: none; }
.rc-category-card__desc { margin: calc(0.35 * var(--rc-fs)) 0; font-size: calc(0.9 * var(--rc-fs)); color: var(--rc-muted); }
.rc-category-card__meta { margin: 0; font-size: calc(0.8 * var(--rc-fs)); color: var(--rc-muted); }

/* Thread list */
.rc-thread-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rc-border); border-radius: var(--rc-r); overflow: hidden; }
.rc-thread-item { display: flex; gap: calc(1 * var(--rc-fs)); padding: calc(0.85 * var(--rc-fs) * var(--rc-s)) calc(1 * var(--rc-fs)); border-top: 1px solid var(--rc-border); align-items: center; }
.rc-thread-item:first-child { border-top: 0; }
.rc-thread-item--pinned { background: var(--rc-bg-soft); }
.rc-thread-item__main { flex: 1; min-width: 0; }
.rc-thread-item__title { font-weight: 600; text-decoration: none; display: block; }
.rc-thread-item__title:hover { text-decoration: underline; }
.rc-thread-item__excerpt { margin: calc(0.25 * var(--rc-fs)) 0; font-size: calc(0.9 * var(--rc-fs)); color: var(--rc-muted); }
.rc-thread-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: calc(0.5 * var(--rc-fs)); margin-top: calc(0.25 * var(--rc-fs)); font-size: calc(0.85 * var(--rc-fs)); color: var(--rc-muted); }
.rc-thread-item__stats { display: flex; flex-direction: column; align-items: flex-end; gap: calc(0.15 * var(--rc-fs)); font-size: calc(0.85 * var(--rc-fs)); color: var(--rc-muted); white-space: nowrap; }
.rc-flag { margin-right: calc(0.25 * var(--rc-fs)); }
.rc-chip { font-size: calc(0.75 * var(--rc-fs)); padding: calc(0.1 * var(--rc-fs)) calc(0.5 * var(--rc-fs)); border-radius: 999px; background: var(--rc-bg-soft); text-decoration: none; }
mark { background: #fff2a8; padding: 0 0.1em; }

/* Author line, avatars, badges */
.rc-author { display: inline-flex; align-items: center; gap: calc(0.4 * var(--rc-fs)); }
.rc-author__name { font-weight: 600; }
.rc-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: calc(0.7 * var(--rc-fs)); font-weight: 700; background: var(--rc-a); color: #fff; }
.rc-thread-item .rc-avatar { width: 20px; height: 20px; font-size: calc(0.6 * var(--rc-fs)); border-radius: 50% 50% 0 0; }
.rc-badge { font-size: calc(0.7 * var(--rc-fs)); font-weight: 700; padding: calc(0.1 * var(--rc-fs)) calc(0.45 * var(--rc-fs)); border-radius: 4px; text-transform: uppercase; letter-spacing: 0.02em; }
.rc-badge--official { background: var(--rc-a); color: var(--rc-on-a); }
.rc-badge--mod { background: #e6f0ff; color: #1d4ed8; }
.rc-badge--muted { background: var(--rc-bg-soft); color: var(--rc-muted); }
.rc-time { color: var(--rc-muted); font-size: 0.85em; }

/* Thread page */
.rc-thread__head { margin-bottom: calc(1 * var(--rc-fs)); }
.rc-thread__meta { display: flex; flex-wrap: wrap; align-items: center; gap: calc(0.5 * var(--rc-fs)); margin-top: calc(0.35 * var(--rc-fs)); font-size: calc(0.9 * var(--rc-fs)); }
/* Post bodies (opening post + replies). Merchants can give them their own font / size
   under Appearance (--rc-body-font, --rc-body-font-size); otherwise they follow the
   forum font, with the opening post at 1.05×. */
.rc-body { font-family: var(--rc-body-font, inherit); font-size: var(--rc-body-font-size, inherit); }
.rc-thread__body { font-size: var(--rc-body-font-size, 1.05em); }
.rc-thread__foot, .rc-reply__foot { display: flex; flex-wrap: wrap; gap: calc(0.75 * var(--rc-fs)) calc(1 * var(--rc-fs)); align-items: center; margin-top: calc(0.75 * var(--rc-fs)); }
.rc-like { background: var(--rc-bg-soft); border: 1px solid var(--rc-border); border-radius: 999px; padding: calc(0.25 * var(--rc-fs)) calc(0.7 * var(--rc-fs)); font: inherit; font-size: calc(0.9 * var(--rc-fs)); cursor: pointer; color: inherit; }
.rc-like--on { background: var(--rc-a); color: var(--rc-on-a); border-color: var(--rc-a); }

.rc-body p { margin: 0 0 calc(0.75 * var(--rc-fs)); }
.rc-body blockquote { margin: 0 0 calc(0.75 * var(--rc-fs)); padding: calc(0.25 * var(--rc-fs)) calc(1 * var(--rc-fs)); border-left: 3px solid var(--rc-border); color: var(--rc-muted); }
.rc-body pre { background: var(--rc-bg-soft); padding: calc(0.75 * var(--rc-fs)); border-radius: var(--rc-r); overflow-x: auto; font-size: 0.9em; }
.rc-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.rc-body ul, .rc-body ol { padding-left: calc(1.5 * var(--rc-fs)); margin: 0 0 calc(0.75 * var(--rc-fs)); }
.rc-video { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; margin: 0 0 calc(0.75 * var(--rc-fs)); border-radius: var(--rc-r); overflow: hidden; background: #000; }
.rc-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Product card */
/* Fixed card height so the image can be a full-height square (a stretched flex item only
   gets its width from aspect-ratio when the container height is definite). */
.rc-product-card { display: flex; align-items: stretch; box-sizing: border-box; height: calc(6.5 * var(--rc-fs)); max-width: 480px; margin: 0 0 calc(0.75 * var(--rc-fs)); padding: 0; border: 1px solid var(--rc-border); border-radius: var(--rc-r); overflow: hidden; text-decoration: none; background: #fff; line-height: 1.35; }
.rc-product-card__img { height: 100%; width: auto; aspect-ratio: 1 / 1; object-fit: cover; flex-shrink: 0; border-radius: 0; background: var(--rc-bg-soft); }
.rc-product-card__body { display: flex; flex-direction: column; justify-content: center; gap: calc(0.15 * var(--rc-fs)); min-width: 0; padding: calc(0.5 * var(--rc-fs)) calc(0.75 * var(--rc-fs)); overflow: hidden; }
.rc-product-card__title { font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.rc-product-card__price { font-size: calc(0.95 * var(--rc-fs)); }
.rc-product-card__cta { font-size: calc(0.8 * var(--rc-fs)); color: var(--rc-a); font-weight: 600; }
.rc-product-card--missing { height: auto; padding: calc(0.6 * var(--rc-fs)); color: var(--rc-muted); font-size: calc(0.9 * var(--rc-fs)); }

/* Replies */
.rc-replies { display: grid; gap: calc(0.75 * var(--rc-fs)); }
.rc-replies { gap: calc(0.75 * var(--rc-fs) * var(--rc-s)); }
.rc-reply { border: 1px solid var(--rc-border); border-radius: var(--rc-r); padding: calc(0.85 * var(--rc-fs) * var(--rc-s)) calc(1 * var(--rc-fs)); }
.rc-reply--child { margin-left: calc(1.5 * var(--rc-fs)); }
.rc-reply--accepted { border-color: #12b76a; background: #f0fdf4; margin-bottom: calc(0.75 * var(--rc-fs)); }
.rc-reply__accepted-label { color: #027a48; font-weight: 700; font-size: calc(0.85 * var(--rc-fs)); margin-bottom: calc(0.35 * var(--rc-fs)); }
.rc-reply__head { display: flex; flex-wrap: wrap; gap: calc(0.5 * var(--rc-fs)); align-items: center; margin-bottom: calc(0.5 * var(--rc-fs)); font-size: calc(0.9 * var(--rc-fs)); }
.rc-reply__to { color: var(--rc-muted); font-size: calc(0.85 * var(--rc-fs)); }

/* Forms & composer */
.rc-form, .rc-composer { margin-top: calc(1.5 * var(--rc-fs)); }
.rc-field { display: block; margin-bottom: calc(1 * var(--rc-fs)); }
.rc-field__label { display: block; font-weight: 600; font-size: calc(0.9 * var(--rc-fs)); margin-bottom: calc(0.3 * var(--rc-fs)); }
.rc-input { width: 100%; }
select.rc-input { appearance: auto; }
.rc-form__actions { display: flex; gap: calc(0.5 * var(--rc-fs)); margin-top: calc(0.75 * var(--rc-fs)); }
.rc-form__error { color: #b42318; margin: calc(0.5 * var(--rc-fs)) 0 0; font-size: calc(0.9 * var(--rc-fs)); }
.rc-replying-to { font-size: calc(0.9 * var(--rc-fs)); margin-bottom: calc(0.5 * var(--rc-fs)); color: var(--rc-muted); }
.rc-composer--signin { padding: calc(1.5 * var(--rc-fs)); border: 1px dashed var(--rc-border); border-radius: var(--rc-r); text-align: center; }
.rc-inline-edit { margin: calc(0.5 * var(--rc-fs)) 0; }

/* Editor (TipTap) */
.rc-editor { border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: #fff; }
.rc-editor:focus-within { border-color: var(--rc-a); box-shadow: 0 0 0 1px var(--rc-a); }
.rc-editor__toolbar { display: flex; flex-wrap: wrap; gap: calc(0.15 * var(--rc-fs)); padding: calc(0.35 * var(--rc-fs)); border-bottom: 1px solid var(--rc-border); position: sticky; top: 0; background: #fff; z-index: 1; border-radius: var(--rc-r) var(--rc-r) 0 0; }
.rc-editor__btn { border: 0; background: transparent; padding: calc(0.3 * var(--rc-fs)) calc(0.55 * var(--rc-fs)); border-radius: 4px; font: inherit; font-size: calc(0.85 * var(--rc-fs)); cursor: pointer; color: inherit; line-height: 1.2; }
.rc-editor__btn:hover { background: var(--rc-bg-soft); }
.rc-editor__btn--active { background: var(--rc-a); color: var(--rc-on-a); }
.rc-editor__area { padding: 0; }
.rc-editor__content { min-height: 160px; padding: calc(0.75 * var(--rc-fs)); outline: none; white-space: pre-wrap; word-wrap: break-word; }
.rc-editor__content p { margin: 0 0 calc(0.6 * var(--rc-fs)); }
.rc-editor__content p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--rc-muted); float: left; height: 0; pointer-events: none; }
.rc-editor__content h2 { font-size: calc(1.3 * var(--rc-fs)); margin: calc(0.5 * var(--rc-fs)) 0; }
.rc-editor__content h3 { font-size: calc(1.1 * var(--rc-fs)); margin: calc(0.5 * var(--rc-fs)) 0; }
.rc-editor__content blockquote { margin: 0 0 calc(0.6 * var(--rc-fs)); padding: calc(0.25 * var(--rc-fs)) calc(1 * var(--rc-fs)); border-left: 3px solid var(--rc-border); color: var(--rc-muted); }
.rc-editor__content pre { background: var(--rc-bg-soft); padding: calc(0.75 * var(--rc-fs)); border-radius: var(--rc-r); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; overflow-x: auto; }
.rc-editor__content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--rc-bg-soft); padding: 0.1em 0.3em; border-radius: 3px; }
.rc-editor__content pre code { background: none; padding: 0; }
.rc-editor__content ul, .rc-editor__content ol { padding-left: calc(1.5 * var(--rc-fs)); margin: 0 0 calc(0.6 * var(--rc-fs)); }
.rc-editor__content a { color: var(--rc-a); text-decoration: underline; }
.rc-editor__content .rc-product { display: flex; align-items: center; gap: calc(0.6 * var(--rc-fs)); padding: calc(0.5 * var(--rc-fs)); margin: calc(0.5 * var(--rc-fs)) 0; border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); font-size: calc(0.9 * var(--rc-fs)); user-select: none; cursor: grab; }
.rc-editor__content .rc-product img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.rc-editor__content .rc-product__body { display: flex; flex-direction: column; gap: calc(0.1 * var(--rc-fs)); }
.rc-editor__content .rc-product__title { font-weight: 600; }
.rc-editor__content .rc-product__price { color: var(--rc-muted); font-size: 0.85em; }
.rc-editor__content .rc-video { pointer-events: none; }
.rc-editor__content .ProseMirror-selectednode { outline: 2px solid var(--rc-a); outline-offset: 2px; }
.rc-editor__content .ProseMirror-gapcursor { display: none; pointer-events: none; position: relative; }
.rc-editor__content .ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid currentColor; animation: rc-blink 1.1s steps(2, start) infinite; }
.rc-editor__content.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
@keyframes rc-blink { to { visibility: hidden; } }
.rc-editor__fallback { width: 100%; border: 0; border-radius: var(--rc-r); }

/* Mentions */
.rc-mention { color: var(--rc-a); font-weight: 600; background: color-mix(in srgb, var(--rc-a) 10%, transparent); border-radius: 4px; padding: 0 0.25em; }

/* Thread references ("portals" to another thread) */
.rc-thread-ref { display: inline-flex; align-items: center; gap: 0.3em; max-width: 100%; vertical-align: baseline; padding: 0.05em 0.6em 0.05em 0.45em; border: 1px solid color-mix(in srgb, var(--rc-a) 35%, var(--rc-border)); border-radius: 999px; background: color-mix(in srgb, var(--rc-a) 8%, transparent); color: var(--rc-a); font-weight: 600; font-size: 0.95em; line-height: 1.5; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-thread-ref::before { content: "⤴"; font-weight: 400; flex-shrink: 0; }
.rc-thread-ref:hover { background: color-mix(in srgb, var(--rc-a) 16%, transparent); text-decoration: none; }
.rc-body a.rc-thread-ref, .rc-editor__content a.rc-thread-ref { text-decoration: none; }
.rc-editor__content .rc-thread-ref { cursor: default; user-select: none; }
.rc-suggest__item--thread { flex-direction: column; align-items: flex-start; gap: calc(0.1 * var(--rc-fs)); }
.rc-suggest__item--thread .rc-suggest__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rc-suggest__meta { color: var(--rc-muted); font-size: calc(0.8 * var(--rc-fs)); }
.rc-suggest { position: absolute; z-index: 1000; min-width: 200px; max-width: 320px; background: #fff; border: 1px solid var(--rc-border); border-radius: var(--rc-r); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); padding: calc(0.25 * var(--rc-fs)); }
.rc-suggest__item { display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); width: 100%; text-align: left; background: none; border: 0; padding: calc(0.4 * var(--rc-fs)) calc(0.6 * var(--rc-fs)); font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.rc-suggest__item--active, .rc-suggest__item:hover { background: var(--rc-bg-soft); }
.rc-suggest__name { flex: 1; }
.rc-suggest__empty { padding: calc(0.4 * var(--rc-fs)) calc(0.6 * var(--rc-fs)); color: var(--rc-muted); font-size: calc(0.9 * var(--rc-fs)); }

/* Product picker */
.rc-picker { border-top: 1px solid var(--rc-border); padding: calc(0.5 * var(--rc-fs)); }
.rc-picker__head { display: flex; gap: calc(0.5 * var(--rc-fs)); align-items: center; margin-bottom: calc(0.5 * var(--rc-fs)); }
.rc-picker__list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.rc-picker__item { display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); width: 100%; text-align: left; background: none; border: 0; padding: calc(0.4 * var(--rc-fs)); font: inherit; cursor: pointer; border-radius: 4px; color: inherit; }
.rc-picker__item:hover { background: var(--rc-bg-soft); }
.rc-picker__item img, .rc-picker__noimg { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--rc-bg-soft); flex-shrink: 0; }
.rc-picker__title { flex: 1; }

/* Alerts & pagination */
.rc-alert { padding: calc(0.75 * var(--rc-fs)) calc(1 * var(--rc-fs)); border-radius: var(--rc-r); margin-bottom: calc(1 * var(--rc-fs)); background: var(--rc-bg-soft); border: 1px solid var(--rc-border); }
.rc-alert--warning { background: #fffaeb; border-color: #fedf89; }
.rc-alert--error { background: #fef3f2; border-color: #fda29b; }
.rc-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: calc(1 * var(--rc-fs)); }
.rc-pagination__info { color: var(--rc-muted); font-size: calc(0.9 * var(--rc-fs)); }

@media (max-width: 640px) {
  .rc-thread-item { flex-direction: column; align-items: stretch; gap: calc(0.35 * var(--rc-fs)); }
  .rc-thread-item__stats { flex-direction: row; gap: calc(0.75 * var(--rc-fs)); }
  .rc-reply--child { margin-left: calc(0.75 * var(--rc-fs)); }
  .rc-header__title { width: 100%; }
}

/* Images & file attachments in bodies */
.rc-body .rc-image, .rc-editor__content .rc-image { display: block; max-width: 100%; height: auto; margin: 0 0 calc(0.75 * var(--rc-fs)); border-radius: var(--rc-r); }
.rc-file, .rc-editor__content .rc-file { display: inline-flex; align-items: center; gap: calc(0.35 * var(--rc-fs)); padding: calc(0.3 * var(--rc-fs)) calc(0.65 * var(--rc-fs)); margin: 0 0 calc(0.5 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); text-decoration: none; font-size: 0.9em; }
.rc-file::before { content: "📎"; }
.rc-editor__content .rc-upload-pending { display: inline-block; padding: calc(0.3 * var(--rc-fs)) calc(0.65 * var(--rc-fs)); margin: 0 0 calc(0.5 * var(--rc-fs)); border: 1px dashed var(--rc-border); border-radius: var(--rc-r); color: var(--rc-muted); font-size: 0.9em; }
.rc-editor--dragover { outline: 2px dashed var(--rc-a); outline-offset: 2px; }
.rc-editor__file { display: none; }

/* Attachment area under a post (uploads not shown inline in the body) */
.rc-attachments { margin: calc(0.25 * var(--rc-fs)) 0 calc(0.75 * var(--rc-fs)); }
.rc-attachments__label { display: block; font-size: calc(0.85 * var(--rc-fs)); font-weight: 600; color: var(--rc-muted); margin-bottom: calc(0.35 * var(--rc-fs)); }
.rc-attachments__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: calc(0.5 * var(--rc-fs)); }
.rc-attachments__item { display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); max-width: 100%; padding: calc(0.35 * var(--rc-fs)) calc(0.6 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); font-size: 0.9em; }
.rc-attachments__item .rc-file { margin: 0; padding: 0; border: 0; background: none; }
.rc-attachments__thumb { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: calc(var(--rc-r) - 2px); }
.rc-attachments__meta { display: flex; flex-direction: column; gap: calc(0.15 * var(--rc-fs)); min-width: 0; }
.rc-attachments__name { overflow-wrap: anywhere; }

/* Composer attachment area */
.rc-attach__list { list-style: none; margin: 0 0 calc(0.5 * var(--rc-fs)); padding: 0; }
.rc-attach__row { position: relative; display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); padding: calc(0.4 * var(--rc-fs)) calc(0.6 * var(--rc-fs)); margin-bottom: calc(0.35 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); font-size: 0.9em; overflow: hidden; }
.rc-attach__row--pending { color: var(--rc-muted); }
.rc-attach__thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }
.rc-attach__icon { width: 32px; text-align: center; }
.rc-attach__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rc-attach__bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; }
.rc-attach__bar-fill { display: block; height: 100%; width: 0; background: var(--rc-a); transition: width 0.2s; }
.rc-attach__row:not(.rc-attach__row--pending) .rc-attach__bar { display: none; }
.rc-attach__actions { display: flex; align-items: center; gap: calc(0.75 * var(--rc-fs)); flex-wrap: wrap; }
.rc-attach__pick { position: relative; cursor: pointer; }
.rc-attach__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Polls */
.rc-poll { margin: calc(1 * var(--rc-fs)) 0; padding: calc(1 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); }
.rc-poll__question { font-size: calc(1.05 * var(--rc-fs)); margin: 0 0 calc(0.75 * var(--rc-fs)); }
.rc-poll__hint { font-weight: 400; font-size: calc(0.85 * var(--rc-fs)); }
.rc-poll__choice { display: flex; align-items: center; gap: calc(0.6 * var(--rc-fs)); padding: calc(0.5 * var(--rc-fs)) calc(0.75 * var(--rc-fs)); margin-bottom: calc(0.4 * var(--rc-fs)); background: #fff; border: 1px solid var(--rc-border); border-radius: var(--rc-r); cursor: pointer; }
.rc-poll__choice input { accent-color: var(--rc-a); }
.rc-poll__result { margin-bottom: calc(0.6 * var(--rc-fs)); }
.rc-poll__result-head { display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); margin-bottom: calc(0.25 * var(--rc-fs)); }
.rc-poll__label { flex: 1; }
.rc-poll__pct { font-weight: 700; }
.rc-poll__bar { height: 8px; background: rgba(0, 0, 0, 0.08); border-radius: 999px; overflow: hidden; }
.rc-poll__bar-fill { display: block; height: 100%; background: var(--rc-a); border-radius: 999px; transition: width 0.3s ease; }
.rc-poll__result--mine .rc-poll__label::after { content: " ✓"; color: var(--rc-a); font-weight: 700; }
.rc-poll__count { font-size: calc(0.8 * var(--rc-fs)); }
.rc-poll__meta { margin: calc(0.5 * var(--rc-fs)) 0 0; font-size: calc(0.85 * var(--rc-fs)); }
.rc-poll__product { flex: 0 0 auto; }
.rc-product-card--small { max-width: 260px; height: calc(3.5 * var(--rc-fs)); margin: 0; }
.rc-product-card--small .rc-product-card__body { padding: calc(0.3 * var(--rc-fs)) calc(0.5 * var(--rc-fs)); }
.rc-product-card--small .rc-product-card__title { -webkit-line-clamp: 1; }
.rc-product-card--small .rc-product-card__cta { display: none; }
.rc-poll--closed .rc-poll__bar-fill { opacity: 0.7; }

/* Poll builder (new thread) */
.rc-poll-builder { margin-bottom: calc(1 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); }
.rc-poll-builder__toggle { padding: calc(0.6 * var(--rc-fs)) calc(0.9 * var(--rc-fs)); cursor: pointer; font-weight: 600; }
.rc-poll-builder__body { padding: 0 calc(0.9 * var(--rc-fs)) calc(0.9 * var(--rc-fs)); }
.rc-poll-builder__option { margin-bottom: calc(0.4 * var(--rc-fs)); }
.rc-poll-builder__row { display: flex; gap: calc(0.4 * var(--rc-fs)); align-items: center; }
.rc-poll-builder__row .rc-link { text-decoration: none; font-size: var(--rc-fs); }
.rc-poll-builder__chip { display: inline-block; margin: calc(0.25 * var(--rc-fs)) 0 0; cursor: pointer; }
.rc-poll-builder__picker { margin: calc(0.4 * var(--rc-fs)) 0; padding: calc(0.5 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: #fff; }
.rc-check { display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); margin-bottom: calc(1 * var(--rc-fs)); }

/* Guest posting */
.rc-guest { margin: calc(0.75 * var(--rc-fs)) 0; padding: calc(0.75 * var(--rc-fs)) calc(1 * var(--rc-fs)); border: 1px dashed var(--rc-border); border-radius: var(--rc-r); }
.rc-guest__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 calc(1 * var(--rc-fs)); }
.rc-guest .cf-turnstile { margin-bottom: calc(0.5 * var(--rc-fs)); }

/* Reports */
.rc-report { margin: calc(0.75 * var(--rc-fs)) 0 0; padding: calc(0.75 * var(--rc-fs)) calc(1 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); max-width: 520px; }
.rc-reported { font-size: calc(0.85 * var(--rc-fs)); }
.rc-alert--info { background: #eff6ff; border-color: #bfdbfe; }

/* AI bots (Phase 3) */
.rc-badge--ai { background: #f3e8ff; color: #6d28d9; }
.rc-reply--bot { border-left: 3px solid #a78bfa; }
.rc-reply--new { animation: rc-fade-in 0.5s ease-out; }
@keyframes rc-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.rc-bot-sources { margin: calc(0.5 * var(--rc-fs)) 0 calc(0.25 * var(--rc-fs)); font-size: calc(0.85 * var(--rc-fs)); color: var(--rc-muted); display: flex; flex-wrap: wrap; gap: calc(0.25 * var(--rc-fs)) calc(0.4 * var(--rc-fs)); align-items: baseline; }
.rc-bot-sources__label { font-weight: 600; }
.rc-bot-sources__list { margin: 0; padding: 0; list-style: none; display: inline-flex; flex-wrap: wrap; gap: calc(0.25 * var(--rc-fs)); }
.rc-bot-sources__list li { padding: calc(0.05 * var(--rc-fs)) calc(0.5 * var(--rc-fs)); border-radius: 999px; background: var(--rc-bg-soft); }
.rc-typing { display: flex; align-items: center; gap: calc(0.5 * var(--rc-fs)); margin: calc(0.75 * var(--rc-fs)) 0; padding: calc(0.6 * var(--rc-fs)) calc(1 * var(--rc-fs)); border: 1px dashed var(--rc-border); border-radius: var(--rc-r); color: var(--rc-muted); font-size: calc(0.9 * var(--rc-fs)); }
.rc-typing__dots i { display: inline-block; width: 4px; height: 4px; margin-left: 3px; border-radius: 50%; background: currentColor; animation: rc-blink 1.2s infinite; }
.rc-typing__dots i:nth-child(2) { animation-delay: 0.2s; }
.rc-typing__dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes rc-blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Member profile (Phase 4) */
.rc-author__name { text-decoration: none; }
a.rc-author__name:hover { text-decoration: underline; }
.rc-profile__head { display: flex; gap: calc(1.25 * var(--rc-fs)); align-items: center; }
.rc-profile__avatar .rc-avatar { width: 96px; height: 96px; font-size: calc(2 * var(--rc-fs)); }
.rc-profile__stats { display: flex; gap: calc(1.25 * var(--rc-fs)); margin: calc(0.5 * var(--rc-fs)) 0 0; padding: 0; list-style: none; color: var(--rc-muted); font-size: calc(0.9 * var(--rc-fs)); }
.rc-profile__stats strong { color: inherit; font-size: calc(1.1 * var(--rc-fs)); margin-right: calc(0.25 * var(--rc-fs)); }
.rc-profile__settings { border: 1px solid var(--rc-border); border-radius: var(--rc-r); padding: calc(1 * var(--rc-fs)); }
.rc-profile__avatar-row { display: flex; flex-wrap: wrap; gap: calc(0.5 * var(--rc-fs)); align-items: center; }
.rc-profile__avatar-row .rc-input { flex: 1 1 220px; }
.rc-profile__replies { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(0.75 * var(--rc-fs)); }
.rc-profile__reply { border: 1px solid var(--rc-border); border-radius: var(--rc-r); padding: calc(0.75 * var(--rc-fs)) calc(1 * var(--rc-fs)); }
.rc-profile__reply-text { margin: 0 0 calc(0.35 * var(--rc-fs)); }

/* Advanced presets (Phase 4). Accent / radius / spacing come from CSS variables; these add surfaces. */
.rc-preset--night { --rc-border: rgba(255, 255, 255, 0.14); --rc-muted: rgba(255, 255, 255, 0.62); --rc-bg-soft: rgba(255, 255, 255, 0.06); background: #0f1117; color: #f4f4f5; border-radius: var(--rc-r); }
.rc-preset--night .rc-input, .rc-preset--night .rc-search__input, .rc-preset--night .rc-editor__area, .rc-preset--night .rc-editor__toolbar { background: #1a1d27; color: inherit; border-color: var(--rc-border); }
.rc-preset--night .rc-reply--accepted { background: rgba(18, 183, 106, 0.12); }
.rc-preset--night .rc-alert { background: var(--rc-bg-soft); color: inherit; }
.rc-preset--night .rc-alert--warning { background: rgba(253, 224, 71, 0.12); border-color: rgba(253, 224, 71, 0.35); }
.rc-preset--night .rc-alert--info { background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.35); }
.rc-preset--night .rc-badge--mod { background: rgba(96, 165, 250, 0.2); color: #bfdbfe; }
.rc-preset--night .rc-badge--ai { background: rgba(167, 139, 250, 0.2); color: #ddd6fe; }
.rc-preset--night .rc-btn--secondary { background: #1a1d27; color: inherit; border-color: var(--rc-border); }
.rc-preset--warm { --rc-border: rgba(120, 72, 32, 0.18); --rc-muted: rgba(80, 50, 30, 0.7); --rc-bg-soft: rgba(194, 65, 12, 0.06); background: #fbf6ef; color: #2b1d14; border-radius: var(--rc-r); padding-left: calc(1.25 * var(--rc-fs)); padding-right: calc(1.25 * var(--rc-fs)); }
.rc-preset--warm .rc-h1, .rc-preset--warm .rc-h2 { letter-spacing: -0.01em; }
.rc-preset--warm .rc-reply, .rc-preset--warm .rc-category-card, .rc-preset--warm .rc-thread-item { background: #fffdf9; }
.rc-preset--tech { --rc-border: rgba(14, 165, 233, 0.35); --rc-muted: rgba(0, 0, 0, 0.55); --rc-bg-soft: rgba(14, 165, 233, 0.07); }
.rc-preset--tech .rc-h1, .rc-preset--tech .rc-h2 { text-transform: uppercase; letter-spacing: 0.06em; font-size: calc(1.1 * var(--rc-fs)); }
.rc-preset--tech .rc-h1 { font-size: calc(1.4 * var(--rc-fs)); }
.rc-preset--tech .rc-reply, .rc-preset--tech .rc-thread-item, .rc-preset--tech .rc-category-card { border-left: 2px solid var(--rc-a); }
.rc-preset--tech .rc-badge { border-radius: 0; }

/* Linked product (optional) */
.rc-field__hint { margin: calc(0.3 * var(--rc-fs)) 0 0; font-size: calc(0.8 * var(--rc-fs)); color: var(--rc-muted); }
.rc-product-list { list-style: none; margin: 0 0 calc(0.5 * var(--rc-fs)); padding: 0; display: flex; flex-direction: column; gap: calc(0.4 * var(--rc-fs)); }
.rc-product-list:empty { margin: 0; }
.rc-product-select { display: flex; align-items: center; gap: calc(0.6 * var(--rc-fs)); padding: calc(0.5 * var(--rc-fs)) calc(0.6 * var(--rc-fs)); border: 1px solid var(--rc-border); border-radius: var(--rc-r); background: var(--rc-bg-soft); }
.rc-product-select__img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.rc-product-select__title { flex: 1; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rc-product-search { position: relative; }
.rc-product-search .rc-picker__list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: calc(0.25 * var(--rc-fs)); padding: calc(0.25 * var(--rc-fs)); background: #fff; border: 1px solid var(--rc-border); border-radius: var(--rc-r); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }
.rc-chip--product { background: var(--rc-a); color: var(--rc-on-a); }
.rc-forum a.rc-chip--product { color: var(--rc-on-a); }
.rc-thread__product { margin: 0 0 calc(1 * var(--rc-fs)); }
.rc-thread__product .rc-product-card { margin: 0; }
.rc-thread__product-label { display: block; margin-bottom: calc(0.35 * var(--rc-fs)); font-size: calc(0.8 * var(--rc-fs)); color: var(--rc-muted); }
.rc-thread__product-list { display: flex; flex-wrap: wrap; gap: calc(0.75 * var(--rc-fs)); }
.rc-thread__product-item { display: flex; flex-direction: column; gap: calc(0.25 * var(--rc-fs)); flex: 1 1 260px; max-width: 100%; min-width: 0; }
/* Several linked products: 3-up grid (2-up on tablets, 1-up on phones) */
.rc-thread__product-list--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rc-thread__product-list--grid .rc-product-card--small { max-width: none; }
@media (max-width: 900px) { .rc-thread__product-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rc-thread__product-list--grid { grid-template-columns: minmax(0, 1fr); } }
.rc-thread__product-all { font-size: calc(0.8 * var(--rc-fs)); color: var(--rc-muted); }
.rc-picker__item--chosen { opacity: 0.5; cursor: default; }
