:root {
  --bg: #f6f5f2; --panel: #fff; --ink: #1d2321; --muted: #6b726f; --line: #e4e2dc;
  --brand: #2f6b4f; --brand-ink: #fff; --brand-soft: #e6f0ea;
  --warn: #b7791f; --warn-soft: #fbf1df; --danger: #b23b3b; --danger-soft: #f8e5e5;
  --info: #2b5c8a; --info-soft: #e3edf6; --violet: #6a4c93; --violet-soft: #eee8f5;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151817; --panel: #1e2221; --ink: #e8ebe9; --muted: #9aa29e; --line: #2e3432;
    --brand: #5fae86; --brand-ink: #0e1512; --brand-soft: #1f3329;
    --warn: #e0a84a; --warn-soft: #3a2f1c; --danger: #e07a7a; --danger-soft: #3a2222;
    --info: #7fb0dd; --info-soft: #1d2b38; --violet: #b49ade; --violet-soft: #2c2538;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(14px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; }
.top .t { font-weight: 700; font-size: 17px; line-height: 1.1; }
.top .s { font-size: 12px; color: var(--muted); }
.page { padding: 4px 16px calc(96px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
h1 { font-size: 24px; margin: 6px 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: var(--safe-b); z-index: 6; }
.tabbar button { background: none; border: 0; padding: 10px 0 9px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--brand); font-weight: 600; }
.dot { position: absolute; top: 6px; left: calc(50% + 8px); background: var(--danger); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
label.l { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); outline: none; font-size: 16px;
}
input:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 8px 14px; font-size: 14px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.capture { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cap { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; position: relative; }
.cap svg { width: 28px; height: 28px; color: var(--brand); }
.cap.big { grid-column: span 2; flex-direction: row; justify-content: center; padding: 18px; background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-size: 16px; }
.cap.big svg { color: var(--brand-ink); }
.cap input { position: absolute; inset: 0; opacity: 0; width: 100%; }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.th { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; padding: 2px; }
.th img, .th video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 99px; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 1; z-index: 2; }
.th .k { position: absolute; bottom: 4px; left: 4px; z-index: 2; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 99px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; padding: 14px; border-radius: 12px; background: var(--warn-soft); }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }

.btn { width: 100%; border: 0; border-radius: 14px; padding: 16px; font-weight: 600; font-size: 16px; background: var(--brand); color: var(--brand-ink); }
.btn.sec { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 8px 0; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 12px 0 4px; }
.progress > div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.ptext { font-size: 13px; color: var(--muted); text-align: center; }

.case { display: flex; align-items: center; gap: 12px; }
.case .b { flex: 1; min-width: 0; }
.case .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case .m { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.e-recibido { background: var(--warn-soft); color: var(--warn); }
.e-en_revision { background: var(--info-soft); color: var(--info); }
.e-en_edicion { background: var(--violet-soft); color: var(--violet); }
.e-publicado { background: var(--brand-soft); color: var(--brand); }
.e-necesita_info { background: var(--danger-soft); color: var(--danger); }
.note { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 10px; }
.timeline { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.timeline li { padding: 6px 0 6px 12px; border-left: 2px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.muted { color: var(--muted); }

.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.login .mark { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 18px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; display: flex; align-items: flex-end; }
.sheet-card { background: var(--panel); width: 100%; max-height: 88vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + var(--safe-b)); position: relative; }
.sheet-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 28px; color: var(--muted); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-b)); background: var(--ink); color: var(--bg); padding: 14px 16px; border-radius: 12px; font-size: 14px; z-index: 20; text-align: center; }
.install { display: flex; gap: 10px; align-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.install b { flex: 1; font-weight: 500; }
.install button { background: none; border: 0; color: inherit; font-size: 18px; }

.msg { background: var(--bg); border-radius: 12px 12px 12px 4px; padding: 8px 12px; font-size: 14px; margin-bottom: 6px; max-width: 85%; white-space: pre-wrap; }
.msg.mine { background: var(--brand-soft); margin-left: auto; border-radius: 12px 12px 4px 12px; }
.who-m { font-size: 11px; color: var(--muted); }
a.th { text-decoration: none; }
