:root {
  --bg: #f6f1ee;
  --bg2: #efe6e2;
  --card: #ffffff;
  --line: #e5d4cd;
  --text: #2a1a20;
  --muted: #7a5f68;
  --wine: #b4234a;
  --wine2: #861635;
  --gold: #9a6b1f;
  --ok: #2f8f5b;
  --err: #c43c3c;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--wine); text-decoration: none; }
a:hover { color: var(--wine2); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96); position: sticky; top: 0; z-index: 10;
}
.brand { color: var(--text); font-size: 1.35rem; letter-spacing: 0.08em; text-transform: uppercase; }
.brand span {
  margin-left: 0.45rem; font-size: 0.7rem; color: var(--wine);
  border: 1px solid var(--wine); padding: 0.1rem 0.35rem; border-radius: 999px;
}
.top nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.95rem; }
.top nav a { color: var(--muted); }
.top nav a.on, .top nav a:hover { color: var(--text); }
.top nav a.nav-sair {
  color: #fff; background: var(--wine); border-radius: 8px;
  padding: 0.25rem 0.7rem;
}
.top nav a.nav-sair:hover { background: var(--wine2); color: #fff; }
.bell-wrap { position: relative; }
.bell-btn {
  position: relative; background: none; border: 0; color: var(--muted);
  cursor: pointer; padding: 0.15rem; display: grid; place-items: center;
}
.bell-btn:hover { color: var(--text); }
.bell-dot {
  position: absolute; top: -0.25rem; right: -0.35rem; min-width: 1rem; height: 1rem;
  padding: 0 0.22rem; border-radius: 999px; background: var(--wine); color: #fff;
  font-size: 0.65rem; line-height: 1rem; font-family: sans-serif;
}
.bell-box {
  position: absolute; right: 0; top: calc(100% + 0.6rem); width: min(320px, 86vw);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35); z-index: 30; padding: 0.5rem 0 0.3rem;
}
.bell-head, .bell-all { display: flex; justify-content: space-between; padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.bell-empty { color: var(--muted); padding: 0.8rem 0.85rem; font-size: 0.88rem; }
.bell-item { display: block; padding: 0.55rem 0.85rem; color: var(--text); border-top: 1px solid var(--line); }
.bell-item strong, .note-row strong { display: block; font-size: 0.9rem; }
.bell-item small, .note-row small { display: block; color: var(--muted); font-size: 0.78rem; }
.bell-item.new, .note-row.new { background: #f8eef1; }
.bell-item:hover, .note-row:hover { background: #f3e6ea; color: var(--text); }
.note-row {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0;
  border-bottom: 1px solid var(--line); color: var(--text);
}
.note-row em { color: var(--muted); font-style: normal; font-size: 0.78rem; white-space: nowrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.2rem 3rem; }
.minimal { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }

.hero { max-width: 640px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin-bottom: 0.8rem; }
.hero p { color: var(--muted); font-size: 1.08rem; margin-bottom: 1.2rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.4rem 1.5rem; margin-bottom: 1.2rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.person-card { display: flex; flex-direction: column; margin-bottom: 0; }
.person-card h3 { margin-bottom: 0.15rem; }
.person-card .rel { margin-top: 0.9rem; }
.person-card .rel .btn,
.person-card .rel-sent,
.person-card .rel-friend {
  display: block; width: 100%; text-align: center; box-sizing: border-box;
}
.rel-sent, .rel-friend {
  padding: 0.62rem 0.9rem; border-radius: 10px; font-size: 0.92rem; font-weight: 600;
}
.rel-sent { background: #efe6e2; color: #6a5560; border: 1px solid var(--line); }
.rel-friend { background: #e7f6ec; color: #1e6b3a; border: 1px solid #c8e6d2; }
.btn-reply { background: #9a6b1f; }
.btn-reply:hover { background: #7d5618; color: #fff; }
.thumb {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.thumb .ph {
  height: 180px; display: grid; place-items: center; background:
    linear-gradient(145deg, #f0dce3, #efe6e2); color: var(--muted); font-size: 0.9rem;
}
.thumb .meta { padding: 0.85rem 1rem; }
.thumb h3 { font-size: 1.05rem; }
.thumb p { color: var(--muted); font-size: 0.88rem; }

.btn {
  display: inline-block; background: var(--wine); color: #fff; border: 0;
  padding: 0.7rem 1.15rem; border-radius: 10px; cursor: pointer; font-size: 1rem;
  font-family: inherit;
}
.btn:hover { background: var(--wine2); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
label { display: block; margin: 0.7rem 0 0.3rem; color: var(--muted); font-size: 0.92rem; }
input, select, textarea {
  width: 100%; padding: 0.7rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 1rem;
  font-family: inherit;
}
button { font-family: inherit; }
.alert { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert.ok { background: #e7f6ec; color: #1e6b3a; }
.alert.err { background: #fdeaea; color: #9b1c1c; }
.badge { display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.45rem; border-radius: 999px; }
.badge.pend { background: #fff4d6; color: #8a6a12; }
.badge.ok { background: #e7f6ec; color: #1e6b3a; }
.badge.no { background: #fdeaea; color: #9b1c1c; }
.badge.pre { background: #f8efd6; color: var(--gold); }

.gate { width: min(460px, 100%); }
.gate h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.gate p { color: var(--muted); margin-bottom: 1rem; }
.note { font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem; }

.foot {
  border-top: 1px solid var(--line); padding: 1.5rem; text-align: center;
  color: var(--muted); font-size: 0.88rem;
}
.foot a { margin: 0 0.55rem; color: var(--muted); }
.legal { max-width: 760px; }
.legal h2 { margin: 1.4rem 0 0.5rem; font-size: 1.2rem; }
.legal p, .legal li { color: var(--muted); margin-bottom: 0.7rem; }
.legal ul { padding-left: 1.2rem; }

.admin-body { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: var(--bg); }
.aside { background: #fff; padding: 1.3rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.6rem; }
.aside a { color: var(--muted); }
.aside a.on, .aside a:hover { color: var(--text); }
.admin-main { padding: 1.6rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }

.intro { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 2rem; align-items: start; }
.intro h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; margin: 0.4rem 0 0.8rem; }
.intro > div > p { color: var(--muted); }
.pitch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2.2rem; }
.pitch article { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; }
.pitch h3 { margin-bottom: 0.4rem; font-size: 1.15rem; }
.pitch p { color: var(--muted); }
.kicker { letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; color: var(--gold); }
.modules { margin: 1.4rem 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: 0.55rem; }
.auth-box h2 { margin-bottom: 0.6rem; }
.slim { max-width: 440px; }
.photo-box { max-width: 520px; }
.drop {
  display: block; position: relative; min-height: 240px; margin: 0 0 0.4rem;
  border: 1.5px dashed var(--line); border-radius: 14px; background: #fbf7f5;
  cursor: pointer; overflow: hidden;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .hint {
  display: grid; place-items: center; gap: 0.25rem; min-height: 240px;
  color: var(--muted); text-align: center; padding: 1.4rem;
}
.drop .hint strong { display: block; color: var(--text); font-size: 1.02rem; }
.drop .hint small { display: block; font-size: 0.85rem; }
.drop img { width: 100%; height: 280px; object-fit: cover; display: none; }
.drop.has-img { min-height: 0; }
.drop.has-img img { display: block; }
.drop.has-img .hint { display: none; }
.drop:hover, .drop.on { border-color: var(--wine); background: #f8eef1; }
.page-head { margin-bottom: 1.4rem; }
.page-head p { color: var(--muted); }
.account-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.account-links { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.quiet-btn {
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.88rem; cursor: pointer;
}
.quiet-btn:hover { color: var(--text); border-color: #d4b8b0; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.crumbs span { margin: 0 0.35rem; }
.story-meta { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0.8rem; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0 0.4rem; }
.cat-chips a {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.7rem;
  color: var(--muted); font-size: 0.85rem;
}
.cat-chips a:hover { color: var(--text); border-color: var(--gold); }
.story-home { margin-top: 2.2rem; }
.story-list { display: grid; gap: 0.75rem; }
.story-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.story-row, .story-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.05rem 1.15rem 1.1rem; color: var(--text);
  position: relative; overflow: hidden;
}
.story-row { padding-left: 1.25rem; }
.story-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--wine); opacity: 0; transition: opacity .15s ease;
}
.story-row:hover, .story-card:hover {
  border-color: #d8b8c0; color: var(--text);
  box-shadow: 0 10px 26px rgba(42, 26, 32, 0.06);
}
.story-row:hover::before { opacity: 1; }
.story-kicker {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.7rem; margin-bottom: 0.35rem;
}
.story-kicker em {
  font-style: normal; font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--wine); font-weight: 600;
}
.story-kicker i {
  font-style: normal; font-size: 0.72rem; color: var(--gold);
  border: 1px solid #ead7b0; border-radius: 999px; padding: 0.08rem 0.45rem;
}
.story-row strong, .story-card strong {
  display: block; font-size: 1.12rem; line-height: 1.3; margin-bottom: 0.35rem;
}
.story-row small, .story-card small {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--muted); font-size: 0.9rem; line-height: 1.45;
}
.story-foot {
  display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap;
  margin-top: 0.75rem; font-size: 0.78rem; color: var(--muted);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }
.check { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.check input { width: auto; }
.list { list-style: none; }
.list li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.list em { color: var(--gold); font-style: normal; font-size: 0.8rem; }
.article img { max-width: 100%; border-radius: 12px; }
.article .body { margin-top: 1rem; }
.article .body p, .article .body li { margin-bottom: 0.8rem; }
.article .body h2, .article .body h3 { margin: 1.2rem 0 0.6rem; }
.article .body blockquote { border-left: 3px solid var(--gold); padding-left: 0.8rem; color: var(--muted); }
.editor { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem; border-bottom: 1px solid var(--line); background: #f7f1ee; }
.editor-bar button {
  background: #fff; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.35rem 0.65rem; cursor: pointer; font-size: 0.9rem;
}
.editor-bar button:hover { border-color: var(--gold); color: var(--gold); }
.editor-area { min-height: 280px; padding: 1rem; outline: none; }
.editor-area:focus { box-shadow: inset 0 0 0 1px var(--wine); }
.editor-area p { margin-bottom: 0.7rem; }
.votes { margin: 0.9rem 0 0.4rem; }
.votes strong { display: block; font-size: 0.95rem; }
.votes small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }
.stars { display: flex; gap: 0.15rem; margin: 0.35rem 0; }
.stars .star {
  background: none; border: 0; color: #d3c0c6; font-size: 1.55rem; line-height: 1;
  cursor: pointer; padding: 0 0.05rem;
}
.stars.readonly .star { cursor: default; }
.stars .star.on, .stars button.star:hover { color: var(--gold); }
.aside-sub { color: var(--gold); font-size: 0.78rem; margin-bottom: 0.4rem; }
.comment { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.comment.reply { margin-left: 1.2rem; }
.comment.is-pend { opacity: 0.85; }
.comment-form { margin-top: 1.2rem; }
.inline { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.inline select, .inline input { width: auto; margin: 0; }

.rail-wrap { margin-bottom: 1.8rem; }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.8rem; }
.rail-head h2 { font-size: 1.15rem; }
.rail { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0.65rem; }
.rail-item { min-width: 0; text-align: center; color: var(--text); }
.rail-item strong { display: block; font-size: 0.78rem; margin-top: 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item small { display: block; color: var(--muted); font-size: 0.68rem; }
.avatar {
  width: 64px; height: 64px; max-width: 100%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto;
  background: #f3dde4; border: 2px solid var(--line); font-weight: 700;
  position: relative;
}
.presence {
  position: absolute; right: -1px; bottom: -1px;
  width: 0.74rem; height: 0.74rem; border-radius: 50%;
  border: 2px solid #fff; background: #c4b4b8;
}
.presence.on { background: #22c55e; animation: presence-pulse 1.6s ease-out infinite; }
.presence.away { background: #e4b21a; }
.presence.off { background: #c4b4b8; }
.presence-txt { font-size: 0.8rem; margin-top: 0.15rem; }
.presence-txt.on { color: #1e8a4a; }
.presence-txt.away { color: #9a6b1f; }
.presence-txt.off { color: var(--muted); }
.person-top { display: flex; gap: 0.85rem; align-items: flex-start; }
.person-top .avatar { margin: 0; flex: 0 0 auto; }
.person-top h1 { font-size: 1.45rem; }
@keyframes presence-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .presence.on { animation: none; }
}
.avatar.plus { background: var(--wine); border-color: var(--wine); color: #fff; font-size: 1.6rem; }
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.board-item { position: relative; display: block; background: #eee6e3; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.board-item img, .board-item .ph { width: 100%; height: 100%; object-fit: cover; }
.board-item .ph { display: grid; place-items: center; color: var(--gold); }
.board-item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.4rem 0.5rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font-size: 0.72rem; }

.feed-layout { display: grid; grid-template-columns: 1.6fr 0.8fr; gap: 1.4rem; align-items: start; }
.feed-item h2 { font-size: 1.15rem; font-weight: 600; }
.feed-item h2 span { font-weight: 400; color: var(--muted); }
.feed-item img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-top: 0.6rem; }
.feed-item em { color: var(--gold); font-style: normal; font-size: 0.8rem; margin-left: 0.4rem; }
.feed-side { position: sticky; top: 5rem; }
.dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3dcf7a; margin-right: 0.25rem; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0.4rem 0 1.1rem; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.admin-tabs a {
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.35rem 0.75rem; font-size: 0.88rem;
}
.admin-tabs a.on, .admin-tabs a:hover { color: var(--text); border-color: var(--gold); }
.table-card { padding: 0; overflow: hidden; }
.table-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem 0.9rem;
}
.table-head h2 { margin: 0; font-size: 1.15rem; }
.table-card .empty { padding: 1.4rem 1.3rem 1.8rem; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; }
.mine-table th, .mine-table td { padding: 0.75rem 1rem; vertical-align: middle; }
.mine-table td.titulo { min-width: 220px; }
.mine-table td.now { white-space: nowrap; color: var(--muted); }
.admin-table th {
  color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 600; background: #f3ebe8; white-space: nowrap;
}
.admin-table td strong { display: block; }
.admin-table td small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.2rem; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.row-actions form { display: inline; }
.btn-sm { padding: 0.38rem 0.7rem; font-size: 0.82rem; border-radius: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
body.modal-open { overflow: hidden; }
.modal-bg {
  position: fixed; inset: 0; z-index: 40; background: rgba(8, 4, 7, 0.72);
  padding: 2rem 1rem; overflow: auto;
}
.modal {
  width: min(860px, 100%); margin: 0 auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem 1.4rem 1.5rem;
}
.modal.narrow { width: min(440px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.modal-head h2 { font-size: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.1rem; }
.modal .editor-area { min-height: 240px; }

@media (max-width: 800px) {
  .admin-body { grid-template-columns: 1fr; }
  .top { flex-direction: column; gap: 0.7rem; }
  .intro, .grid-2, .feed-layout, .pitch, .board { grid-template-columns: 1fr 1fr; }
  .feed-layout { grid-template-columns: 1fr; }
  .feed-side { position: static; }
  .rail { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
}
