/* PADYP — sistema visual
   Navy industrial + ámbar de seguridad. Tipografías: Space Grotesk (títulos) / Inter (texto). */
:root {
  --navy-900: #071528;
  --navy-800: #0B1F3A;
  --navy-700: #13305A;
  --navy-600: #1D4378;
  --amber-500: #F5A524;
  --amber-600: #E08A12;
  --amber-100: #FFF3DC;
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --text: #0F1B2D;
  --muted: #5B6B82;
  --line: #E1E7EF;
  --ok: #138A5A;
  --ok-bg: #E3F6EE;
  --danger: #D23B3B;
  --danger-bg: #FDECEC;
  --info: #2563EB;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 4px 14px rgba(11, 31, 58, .06);
  --shadow-lg: 0 10px 30px rgba(11, 31, 58, .14);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Space Grotesk', var(--font);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1322;
    --surface: #111E33;
    --surface-2: #16253D;
    --text: #E7EDF6;
    --muted: #93A3BA;
    --line: #22334F;
    --amber-100: #3A2C10;
    --ok-bg: #0F3326;
    --danger-bg: #3A1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--navy-600); text-decoration: none; }
@media (prefers-color-scheme: dark) { a { color: #7FB2FF; } }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
main.wrap { flex: 1; padding: 24px 0 48px; outline: none; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.center-block { margin: 0 auto 8px; }
.pad { padding: 16px 4px; }
.nowrap { white-space: nowrap; }
.op { opacity: .8; }
.ok-txt { color: var(--ok); font-weight: 600; }
.err-txt { color: var(--danger); font-weight: 600; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber-500); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Íconos */
.ico { width: 18px; height: 18px; flex: none; }
.ico--lg { width: 30px; height: 30px; }
.ico--xl { width: 44px; height: 44px; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, var(--navy-900), var(--navy-800)); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.topbar__in { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; flex: none; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand__txt strong { font-family: var(--font-head); font-size: 1.35rem; letter-spacing: .04em; }
.brand__txt small { font-size: .68rem; color: var(--amber-500); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.search { flex: 1; max-width: 520px; position: relative; }
.search__ico { z-index: 1; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9FB1CC; pointer-events: none; }
#search-input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); color: #fff; padding: 0 16px 0 40px; font: inherit; transition: .2s; }
#search-input::placeholder { color: #9FB1CC; }
#search-input:focus { outline: none; background: rgba(255,255,255,.14); border-color: var(--amber-500); }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav .btn--ghost { color: #E3EAF5; }
.nav .btn--ghost:hover { background: rgba(255,255,255,.1); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, transform .1s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--primary { background: var(--amber-500); color: #1A1200; box-shadow: 0 2px 0 var(--amber-600); }
.btn--primary:hover { background: #FFB43C; }
.btn--light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn--light:hover { background: rgba(255,255,255,.2); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
main .btn--ghost { border-color: var(--line); background: var(--surface); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-txt { color: var(--danger) !important; }
.btn--sm { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 8px; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; position: relative; }
.btn--user { padding: 0 8px 0 4px; gap: 8px; }
.link-btn { background: none; border: 0; padding: 4px 6px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 5px; align-items: center; font-size: .84rem; border-radius: 6px; }
.link-btn:hover { color: var(--text); background: var(--surface-2); }
.link-btn--danger:hover { color: var(--danger); }
.badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown__menu--wide { width: min(360px, 92vw); max-height: 70vh; overflow: auto; }
.dropdown__menu > a, .dropdown__menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; }
.dropdown__menu > a:hover, .dropdown__menu > button:hover { background: var(--surface-2); }
.dropdown__head { font-weight: 700; padding: 8px 10px; font-family: var(--font-head); }
.notif { align-items: flex-start !important; font-size: .88rem; }
.notif span { display: flex; flex-direction: column; }
.notif em { font-style: normal; color: var(--navy-600); }
.notif--new { background: var(--amber-100); }

/* ---------- Avatares ---------- */
.avatar { --h: 210; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 60% 45%), hsl(calc(var(--h) + 40) 65% 38%)); font-family: var(--font-head); letter-spacing: .02em; }
.avatar--xs { width: 22px; height: 22px; font-size: .6rem; }
.avatar--sm { width: 30px; height: 30px; font-size: .7rem; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar--xl { width: 88px; height: 88px; font-size: 1.7rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--amber-500); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.empty h2, .empty h3 { color: var(--text); margin-top: 8px; }
.setup { max-width: 560px; margin: 40px auto; padding: 36px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; background: radial-gradient(1200px 400px at 0% 0%, var(--navy-600), transparent 60%), linear-gradient(135deg, var(--navy-800), var(--navy-900)); color: #fff; border-radius: 20px; padding: clamp(28px, 5vw, 52px); margin-bottom: 28px; }
.hero::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 300px; height: 300px; background: repeating-linear-gradient(45deg, rgba(245,165,36,.18) 0 14px, transparent 14px 28px); border-radius: 50%; filter: blur(.3px); }
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.hero p { color: #C9D5E8; font-size: 1.06rem; max-width: 560px; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--amber-500); margin-bottom: 10px; }
.hero__art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; z-index: 1; }
.hero__tile { aspect-ratio: 1; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: .8rem; color: #C9D5E8; backdrop-filter: blur(4px); transition: transform .3s; }
.hero__tile .ico { width: 34px; height: 34px; color: var(--amber-500); }
.hero__tile:nth-child(even) { transform: translateY(14px); }
.hero__tile:hover { transform: translateY(-4px); }

.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.welcome h1 { margin-bottom: 4px; }
.welcome p { margin: 0; max-width: 680px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.col-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab.active { background: var(--navy-800); color: #fff; }
.tab.active .ico { color: var(--amber-500); }
.tabs--lg { margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; color: var(--muted); font-weight: 500; }
.cat-head, .page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.cat-head .ico, .page-head > .ico { color: var(--amber-600); }
.cat-head h1, .page-head h1 { margin: 0; }
.section-title { margin: 28px 0 12px; }

/* ---------- Tema en listado ---------- */
.topic { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.topic:hover { border-color: var(--amber-500); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.topic--pinned { border-left: 4px solid var(--amber-500); }
.topic__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.topic a:not(.topic__link) { position: relative; z-index: 2; }
.topic__ico { width: 46px; height: 46px; border-radius: 12px; background: var(--amber-100); color: var(--amber-600); display: grid; place-items: center; }
.topic__ico .ico { width: 24px; height: 24px; }
.topic__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.topic__title { margin: 0 0 4px; font-size: 1.08rem; }
.topic__excerpt { color: var(--muted); font-size: .9rem; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; }
.topic__foot span { display: inline-flex; align-items: center; gap: 3px; }
.topic__foot .ico { width: 15px; height: 15px; }
.topic__stats { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 10px; min-width: 120px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.stat small { color: var(--muted); font-size: .76rem; }
.stat--replies { flex-direction: row; align-items: center; gap: 5px; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; }
.stat--replies b { color: var(--text); }
.author { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; }
.author--lg > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
.author--lg small { font-weight: 400; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .75rem; font-weight: 600; color: var(--muted); text-decoration: none !important; }
.pill .ico { width: 14px; height: 14px; }
a.pill:hover { color: var(--text); border-color: var(--muted); }
.pill--pin { background: var(--amber-100); color: var(--amber-600); border-color: transparent; }
.pill--top { background: linear-gradient(90deg, #FFE7A8, #FFD27A); color: #6B4200; border-color: transparent; }
.pill--admin { background: var(--navy-800); color: #fff; border-color: transparent; }
.pill--job { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill--ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill--danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.pill--op { background: var(--navy-700); color: #fff; border-color: transparent; font-size: .68rem; padding: 1px 8px; }

/* ---------- Estrellas ---------- */
.stars { display: inline-flex; gap: 1px; color: #CBD3DF; }
@media (prefers-color-scheme: dark) { .stars { color: #33465F; } }
.star { display: inline-grid; position: relative; }
.star.on, .star.hover { color: var(--amber-500); }
.star__fill { position: absolute; top: 0; left: 0; bottom: 0; width: 50%; overflow: hidden; color: var(--amber-500); }
.stars .ico { width: 18px; height: 18px; }
.stars--sm .ico { width: 14px; height: 14px; }
.stars--lg .ico { width: 30px; height: 30px; }
.stars--input .star { background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 6px; transition: transform .1s; }
.stars--input .star:hover { transform: scale(1.15); }
.stars--input:hover .star.on:not(.hover) { color: #CBD3DF; }

/* ---------- Sidebar ---------- */
.side-card { padding: 18px; }
.side-card h3 { display: flex; align-items: center; gap: 8px; }
.side-card h3 .ico { color: var(--amber-600); }
.side-card__head { display: flex; justify-content: space-between; align-items: baseline; }
.side-card--cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; background: linear-gradient(160deg, var(--amber-100), var(--surface)); }
.side-card--cta > .ico { color: var(--amber-600); }
.cat-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.cat-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); font-size: .9rem; text-decoration: none; }
.cat-list a .ico { color: var(--muted); }
.cat-list a:hover, .cat-list a.active { background: var(--surface-2); }
.cat-list a.active { font-weight: 600; }
.cat-list a.active .ico { color: var(--amber-600); }
.cat-list b { margin-left: auto; font-size: .75rem; color: var(--muted); font-weight: 600; }
.mini-podio { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-podio li { display: flex; align-items: center; gap: 10px; }
.mini-podio a { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; flex: 1; min-width: 0; }
.mini-podio a span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-podio__score { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .85rem; color: var(--amber-600); }
.mini-podio__score .ico { width: 14px; height: 14px; }
.rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .78rem; background: var(--surface-2); color: var(--muted); flex: none; font-family: var(--font-head); }
.rank--1 { background: linear-gradient(135deg, #FFD966, #E8A500); color: #4A3000; }
.rank--2 { background: linear-gradient(135deg, #E8EDF3, #AEB9C6); color: #2B3442; }
.rank--3 { background: linear-gradient(135deg, #F2C29B, #C47A42); color: #3D1F05; }

/* ---------- Detalle del tema ---------- */
.post { padding: clamp(20px, 3vw, 32px); }
.post__head h1 { margin: 6px 0 14px; }
.post__author { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.post__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.prose { font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose--sm { font-size: .94rem; line-height: 1.6; }
.prose p:last-child { margin-bottom: 0; }
.attach { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.attach h4 { display: flex; align-items: center; gap: 6px; font-size: .92rem; color: var(--muted); }
.attach__item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; text-decoration: none !important; font-size: .9rem; }
.attach__item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach__item:hover { border-color: var(--amber-500); }
.attach__item > .ico:first-child { color: var(--amber-600); }
.attach__item.is-loading { opacity: .6; }
.rating { margin-top: 26px; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 18px; border-radius: 12px; background: linear-gradient(90deg, var(--amber-100), transparent); border: 1px solid var(--line); }
.rating__avg { display: flex; align-items: center; gap: 12px; }
.rating__avg > div { display: flex; flex-direction: column; }
.rating__num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.rating__mine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.replies { margin-top: 28px; }
.reply { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.reply--child { box-shadow: none; background: var(--surface-2); padding: 12px 14px; margin: 10px 0 0; border-radius: 10px; }
.reply__children { margin-left: 22px; border-left: 2px solid var(--line); padding-left: 14px; }
.reply__children:empty { display: none; }
.reply__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.reply__actions { display: flex; gap: 4px; margin-top: 6px; margin-left: -6px; }
.reply__form:not(:empty) { margin-top: 10px; }
.reply-box { padding: 18px; margin-top: 18px; }
.comment-form textarea { width: 100%; resize: vertical; }
.comment-form__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cta-inline { display: flex; align-items: center; gap: 10px; padding: 16px 18px; flex-wrap: wrap; margin-top: 16px; }
.cta-inline > span { flex: 1; font-weight: 600; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-card { padding: clamp(20px, 3vw, 32px); max-width: 860px; margin: 0 auto; }
.form-card__head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.form-card__head > .ico { color: var(--amber-600); }
.form-card__head h1 { margin: 0; }
.form-card__head p { margin: 0; }
.form__section { display: flex; align-items: center; gap: 8px; margin: 8px 0 -4px; font-size: .95rem; color: var(--navy-600); border-top: 1px solid var(--line); padding-top: 16px; }
@media (prefers-color-scheme: dark) { .form__section { color: #7FB2FF; } }
.form__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 6px; padding: 0; margin-bottom: 0; }
.field legend { margin-bottom: 6px; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea, .input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { line-height: 1.55; }
input:focus, select:focus, textarea:focus, .input:focus { outline: none; border-color: var(--amber-500); box-shadow: 0 0 0 4px rgba(245,165,36,.18); }
.field--error input, .field--error textarea, .field--error select { border-color: var(--danger); }
.field__err { color: var(--danger); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.pass { position: relative; }
.pass input { padding-right: 44px !important; }
.pass__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; cursor: pointer; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--amber-600); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--radio label { cursor: pointer; }
.chips--radio input { position: absolute; opacity: 0; pointer-events: none; }
.chips--radio span { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 500; background: var(--surface); transition: .15s; }
.chips--radio span .ico { width: 16px; height: 16px; color: var(--muted); }
.chips--radio label:hover span { border-color: var(--muted); }
.chips--radio input:checked + span { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chips--radio input:checked + span .ico { color: var(--amber-500); }
.chips--radio input:focus-visible + span { box-shadow: 0 0 0 4px rgba(245,165,36,.3); }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 2px dashed var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; text-align: center; transition: .15s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ico { width: 28px; height: 28px; color: var(--amber-600); }
.drop.over, .drop:hover { border-color: var(--amber-500); background: var(--amber-100); }
.file-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; }
.file-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li.new { border-color: var(--amber-500); }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: center; padding: 20px 0; }
.auth--wide { grid-template-columns: 1fr 1.35fr; gap: 28px; align-items: start; place-items: stretch; }
.auth__welcome { background: linear-gradient(160deg, var(--navy-800), var(--navy-900)); color: #fff; border-radius: 20px; padding: 32px; position: sticky; top: 90px; }
.auth__welcome h1 { font-size: 1.6rem; margin-top: 4px; }
.auth__welcome p { color: #C9D5E8; }
.eyebrow--light { margin-top: 18px; }
.perks { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 12px; }
.perks li { display: flex; align-items: center; gap: 10px; color: #E3EAF5; }
.perks .ico { color: var(--amber-500); }
.auth__form { padding: clamp(20px, 3vw, 32px); }
.auth__form--narrow { width: min(420px, 100%); }
.auth__links { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }

/* ---------- Perfil ---------- */
.profile { padding: clamp(20px, 3vw, 32px); }
.profile__head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile__id { flex: 1; min-width: 220px; }
.profile__id h1 { margin-bottom: 2px; }
.profile__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 20px; }
.kv { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; align-items: center; }
.kv .ico { grid-row: span 2; color: var(--amber-600); width: 22px; height: 22px; }
.kv span { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kv b { font-weight: 600; overflow-wrap: anywhere; }
.private { margin-top: 22px; padding: 16px; border: 1.5px dashed var(--amber-500); border-radius: 12px; }
.private h4 { display: flex; align-items: center; gap: 6px; margin: 0; }
.private .profile__grid { margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.stats div { text-align: center; padding: 14px; border-radius: 12px; background: var(--navy-800); color: #fff; }
.stats b { display: block; font-family: var(--font-head); font-size: 1.7rem; color: var(--amber-500); }
.stats span { font-size: .8rem; color: #C9D5E8; }

/* ---------- Podio ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 14px; max-width: 760px; margin: 10px auto 28px; }
.podium__place { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--text); text-decoration: none !important; position: relative; }
.podium__place strong { font-family: var(--font-head); font-size: 1.05rem; margin-top: 4px; }
.podium__medal { position: absolute; top: -10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; box-shadow: var(--shadow); transform: translateX(26px); }
.podium__place--1 .podium__medal { background: linear-gradient(135deg, #FFD966, #E8A500); color: #4A3000; }
.podium__place--2 .podium__medal { background: linear-gradient(135deg, #E8EDF3, #AEB9C6); color: #2B3442; }
.podium__place--3 .podium__medal { background: linear-gradient(135deg, #F2C29B, #C47A42); color: #3D1F05; }
.podium__place--1 .avatar { width: 76px; height: 76px; font-size: 1.4rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px #E8A500; }
.podium__block { width: 100%; margin-top: 10px; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; color: #fff; }
.podium__place--1 .podium__block { height: 150px; background: linear-gradient(180deg, var(--amber-500), var(--amber-600)); color: #3A2400; }
.podium__place--2 .podium__block { height: 110px; background: linear-gradient(180deg, var(--navy-600), var(--navy-800)); }
.podium__place--3 .podium__block { height: 80px; background: linear-gradient(180deg, var(--navy-700), var(--navy-900)); }
.podium__place--empty .podium__block { opacity: .3; }
.ranking { list-style: none; padding: 0; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.ranking li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.ranking .author { flex: 1; min-width: 0; }
.ranking .author > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
.ranking .author small { font-weight: 400; }
.ranking__score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .8rem; color: var(--muted); }

/* ---------- Admin ---------- */
.report { padding: 14px 18px; margin-bottom: 10px; }
.report--done { opacity: .6; }
.report__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report__txt { margin: 8px 0; padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--danger); border-radius: 6px; font-size: .9rem; }
.report__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.toolbar .input { max-width: 360px; }

/* ---------- Alertas, toasts, diálogos ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert--danger { background: var(--danger-bg); color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: var(--navy-800); color: #fff; box-shadow: var(--shadow-lg); z-index: 200; transition: transform .3s cubic-bezier(.2,.9,.3,1.2), opacity .2s; max-width: calc(100% - 32px); font-weight: 500; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast--ok .ico { color: #4ADE80; }
.toast--error { background: var(--danger); }
.toast--info .ico { color: var(--amber-500); }
.dialog { border: 0; border-radius: 16px; padding: 24px; width: min(460px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(7, 21, 40, .55); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; gap: 14px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--amber-500); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: #C9D5E8; padding: 26px 0; margin-top: auto; }
.footer__in { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer p { margin: 0; color: #8DA0BC; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .auth--wide { grid-template-columns: 1fr; }
  .auth__welcome { position: static; }
}
@media (max-width: 760px) {
  .topbar__in { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .brand__txt small { display: none; }
  .hide-sm { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .topic { grid-template-columns: 1fr; gap: 8px; }
  .topic__ico { display: none; }
  .topic__stats { flex-direction: row; justify-content: space-between; align-items: center; }
  .stat { align-items: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1; justify-content: center; padding: 8px 10px; }
  .podium { gap: 6px; }
  .podium__place strong { font-size: .9rem; }
  .podium__place .stars, .podium__place .muted { display: none; }
  .reply__children { margin-left: 8px; padding-left: 10px; }
  .stats b { font-size: 1.3rem; }
}
.form > h2 { margin-bottom: -8px; }

/* ---------- Imágenes ---------- */
.fig-img { margin: 22px 0; }
.fig-img__btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: zoom-in; overflow: hidden; min-height: 120px; }
.fig-img img { display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain; background: #fff; }
.fig-img figcaption { margin-top: 8px; font-size: .84rem; color: var(--muted); text-align: center; }
.is-loading { position: relative; }
.is-loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--amber-500); border-radius: 50%; animation: spin .8s linear infinite; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery--sm { grid-template-columns: repeat(auto-fill, minmax(120px, 160px)); margin-top: 6px; }
.gallery__item { aspect-ratio: 4 / 3; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.gallery__item img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; transition: transform .25s; }
.gallery__item:hover img { transform: scale(1.04); }
.reply .attach { margin-top: 10px; }
.thumb { width: 40px; height: 32px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; background: var(--surface-2); }
.file-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-800); color: #fff; font-size: .72rem; flex: none; }
.file-list--sm:empty { display: none; }
.file-list--sm { margin: 8px 0 0; }
.attach-btn { cursor: pointer; }
.comment-form__foot { flex-wrap: wrap; }
.comment-form__foot .muted { flex: 1; }
.dialog--img { width: min(1100px, calc(100% - 24px)); padding: 12px; }
.dialog--img img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #fff; border-radius: 8px; min-height: 120px; }
.dialog__actions--img { align-items: center; }
.dialog__actions--img span { flex: 1; }

/* ---------- Sponsors ---------- */
body { position: relative; }
.sponsors { width: min(1180px, 100% - 32px); margin: 0 auto 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); justify-content: center; gap: 14px; }
.sponsors__label { text-align: center; }
.sponsors__label { grid-column: 1 / -1; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.sponsor { display: block; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sponsor img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sponsor--vacio, .spn-card__img.sponsor--vacio { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); border: 2px dashed var(--line); box-shadow: none; }
.sponsor--vacio span { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--muted); letter-spacing: .04em; }
@media (min-width: 1500px) {
  .sponsors__label { text-align: left; }
  .sponsors { position: absolute; top: 90px; left: max(12px, calc((100vw - 1180px) / 2 - 212px)); width: min(188px, calc((100vw - 1180px) / 2 - 24px)); margin: 0; grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 760px) { .sponsors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.spn-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.spn-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.spn-card h4 { margin: 0; }
.spn-card__img { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); max-width: 210px; }
.spn-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spn-card__btns { display: flex; gap: 8px; }

/* ---------- Compartir ---------- */
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Contenido prerenderizado (para buscadores, se reemplaza al cargar) ---------- */
.prerender { padding: 24px 0; }
.prerender h1 { margin-bottom: 8px; }

/* ---------- Botón Inicio ---------- */
.brand { cursor: pointer; }
.btn--home { color: #E3EAF5; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); flex: none; }
.btn--home:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn--home .ico { color: var(--amber-500); }
@media (max-width: 760px) { .btn--home { padding: 0 10px; height: 36px; } }
@media (max-width: 480px) {
  .nav a[href="/podio"] { display: none; }
  .brand img { width: 32px; height: 32px; }
  .brand__txt strong { font-size: 1.12rem; }
  .nav .btn--primary { padding: 0 12px; }
  .btn--home { padding: 0 9px; gap: 5px; }
  .topbar__in { gap: 8px; }
  .nav { gap: 2px; }
}

/* Sponsors: la caja se adapta a la proporción de la imagen subida (sin recortarla) */
.sponsor:not(.sponsor--vacio) { aspect-ratio: auto; height: auto; background: #fff; }
.sponsor:not(.sponsor--vacio) img { width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.sponsor--vacio { aspect-ratio: 3 / 4; }
.sponsors { align-items: start; }
.spn-card__img:not(.sponsor--vacio) { aspect-ratio: auto; background: #fff; }
.spn-card__img:not(.sponsor--vacio) img { height: auto; max-height: 360px; object-fit: contain; }

/* ---------- Llamado a participar (junto a las pestañas) ---------- */
.cta-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-right: auto; margin-left: 4px; }
.cta-strip__lead { font-family: var(--font-head); font-weight: 700; font-size: .9rem; color: var(--navy-600); margin-right: 2px; }
@media (prefers-color-scheme: dark) { .cta-strip__lead { color: #7FB2FF; } }
.cta-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--amber-500); background: var(--amber-100); color: var(--text); font-weight: 700; font-size: .86rem; cursor: pointer; text-decoration: none !important; transition: transform .12s, background .15s, box-shadow .15s; }
.cta-chip .ico { width: 16px; height: 16px; color: var(--amber-600); }
.cta-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,165,36,.28); }
.cta-chip--main { background: var(--amber-500); color: #1A1200; box-shadow: 0 2px 0 var(--amber-600); }
.cta-chip--main .ico { color: #1A1200; }
@media (max-width: 760px) { .cta-strip { order: 3; width: 100%; margin: 4px 0 0; } .cta-strip__lead { display: inline; } .cta-chip { height: 34px; padding: 0 11px; } }
#count:empty { display: none; }
.cta-strip__lead { white-space: nowrap; }
.toolbar .tab { padding: 8px 12px; }
@media (min-width: 761px) and (max-width: 900px) { .cta-strip__lead { display: none; } }
