:root {
  --bg: #0a0a0a; --card: #171916; --soft: #262a23; --ink: #f4f7ef; --muted: #a7b09e; --line: #30352c;
  --acc: #9ad21c; --acc-soft: #222e0b; --onacc: #0a0a0a; --ok: #7edb5c; --ok-soft: #17301a;
  --warn: #f2c64d; --warn-soft: #33290c; --err: #ff8074; --me: #9ad21c; --onme: #0a0a0a; --them: #171916;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .45);
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.hero { padding: 16px 4px 8px; text-align: center; }
.brand { display: inline-block; }
.brand img { display: block; width: 170px; max-width: 50vw; height: auto; }
.hero .sub { color: var(--acc); font-weight: 700; font-size: 15px; margin-top: 4px; }
.hero .kicker { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }
.hero h1 { margin: 6px 0 0; font-size: 30px; color: var(--ink); line-height: 1.15; letter-spacing: -.01em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice { display: flex; gap: 12px; padding: 14px 16px; margin: 14px 0; background: var(--acc-soft); border-color: transparent; }
.notice .ico { font-size: 22px; line-height: 1.2; }
.notice b { display: block; margin-bottom: 2px; }
.notice p { margin: 0; font-size: 14.5px; color: var(--ink); }
.notice p + p { margin-top: 6px; color: var(--muted); font-size: 13.5px; }

.compose { padding: 16px; margin-top: 14px; }
.compose label { display: block; font-weight: 700; margin-bottom: 8px; }
textarea {
  width: 100%; min-height: 120px; resize: vertical; border: 1px solid var(--line); background: var(--bg);
  border-radius: 14px; padding: 12px 14px; outline: none;
}
textarea:focus, input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.between { justify-content: space-between; }
.count { color: var(--muted); font-size: 13px; }
.btn {
  border: 0; border-radius: 12px; min-height: 46px; padding: 10px 18px; font-weight: 700;
  background: var(--acc); color: var(--onacc); display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.ok { background: var(--ok); color: #0a0a0a; }
.btn.danger { background: transparent; color: var(--err); border: 1px solid var(--line); }
.compose .row { margin-top: 10px; }

.section-title { margin: 28px 4px 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.list { display: grid; gap: 10px; }
.qitem { padding: 14px 16px; text-align: left; width: 100%; border: 1px solid var(--line); display: block; }
.qitem .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.qitem .txt { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ponentes { background: var(--warn-soft); color: var(--warn); }
.pill.respondida { background: var(--ok-soft); color: var(--ok); }
.pill.nueva { background: var(--acc-soft); color: var(--acc); }
.pill.descartada { background: var(--soft); color: var(--muted); text-decoration: line-through; }
.badge { background: var(--acc); color: var(--onacc); border-radius: 99px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.empty { color: var(--muted); text-align: center; padding: 22px 10px; font-size: 14.5px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; }
.msg .meta { font-size: 11.5px; opacity: .75; margin-top: 4px; }
.msg.me { align-self: flex-end; background: var(--me); color: var(--onme); border-bottom-right-radius: 5px; }
.msg.them { align-self: flex-start; background: var(--them); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.them .who { font-size: 12px; font-weight: 700; color: var(--acc); margin-bottom: 2px; }
.reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.reply textarea { min-height: 46px; height: 46px; max-height: 160px; }

.back { background: none; border: 0; color: var(--acc); font-weight: 700; padding: 8px 0; display: inline-flex; align-items: center; gap: 6px; }
.closed { padding: 18px; text-align: center; margin-top: 14px; }
.closed b { display: block; font-size: 18px; margin-bottom: 4px; }
.closed p { margin: 0; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 50;
  max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow);
}
.foot { margin-top: 28px; text-align: center; color: var(--muted); font-size: 12.5px; }
