:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #16201b;
  --muted: #5d6a63;
  --line: #e3e1da;
  --accent: #08593f;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ea;
  --amber: #8a5a00;
  --amber-soft: #fbf0d9;
  --blue: #1f4e8c;
  --blue-soft: #e5edf8;
  --danger: #a12a2a;
  --radius: 14px;
  --tap: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .7rem; display: flex; align-items: center; gap: .5rem; }
h2.sub { margin-top: 1.4rem; font-size: 1rem; color: var(--muted); }
h3 { font-size: 1rem; margin: 1.4rem 0 .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); }
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .6rem 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.brand .logo { width: 28px; height: 28px; flex: 0 0 28px; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .95rem; }
.back { font-size: 1.4rem; text-decoration: none; color: var(--ink); min-width: var(--tap); min-height: var(--tap); display: grid; place-items: center; margin-left: -12px; }
.signout { margin-left: auto; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 120px; }
.foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .85rem; }

.hero { margin: 8px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--muted); font-weight: 600; margin: 0 0 .3rem; }
.intro { color: var(--muted); max-width: 46rem; }
.progress { margin-top: 1rem; max-width: 34rem; }
.bar { height: 10px; border-radius: 99px; background: #e4e2db; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.progress-label { display: block; margin-top: .4rem; font-size: .9rem; color: var(--muted); }

.grid { display: grid; gap: 8px 32px; }
@media (min-width: 1000px) { .grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

.list { display: flex; flex-direction: column; gap: 10px; }
.task-row {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; min-height: 68px;
  transition: border-color .15s, transform .15s;
}
.task-row:active { transform: scale(.99); }
@media (hover: hover) { .task-row:hover { border-color: #c9c6bc; } }
.task-row.todo { border-left: 4px solid var(--accent); }
.list.compact .task-row { min-height: 56px; padding: 10px 14px; }
.tick { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; border: 2px solid #cfccc3; display: grid; place-items: center; font-size: .9rem; color: #fff; }
.task-row.done .tick { background: var(--accent); border-color: var(--accent); }
.task-row.done .task-title { color: var(--muted); }
.task-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-title { font-weight: 600; }
.task-stage { font-size: .85rem; color: var(--muted); }
.pill { font-size: .8rem; font-weight: 600; padding: .3rem .65rem; border-radius: 99px; white-space: nowrap; background: #eeece6; color: var(--muted); }
.pill.todo { background: var(--accent-soft); color: var(--accent); }
.pill.sent, .pill.triloc { background: var(--blue-soft); color: var(--blue); }
.pill.done { background: #eeece6; color: var(--muted); }
.count { background: var(--accent); color: #fff; font-size: .8rem; border-radius: 99px; padding: .1rem .55rem; }
.empty { color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; margin: 0; }
.done-block { margin-top: 2rem; }
.done-block summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.done-block .list { margin-top: .5rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin: 16px 0; }
.card.center { text-align: center; max-width: 34rem; margin: 10vh auto; }
.card.narrow { max-width: 26rem; margin: 8vh auto; }
.task { max-width: 46rem; margin-left: auto; margin-right: auto; }
.task-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; }
.task-head .eyebrow { width: 100%; }
.task-head h1 { margin-right: auto; }
.help { color: var(--muted); margin: .8rem 0 1.2rem; }
.note { background: #f4f3ee; border-radius: 10px; padding: 12px 14px; color: var(--muted); }
.note.ok { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.flash { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.flash.error { background: #f9e3e3; color: var(--danger); }
.from-edgar { background: var(--amber-soft); border-radius: 10px; padding: 12px 14px; margin: .8rem 0; }
.from-edgar strong { display: block; color: var(--amber); font-size: .85rem; }
.amount { font-size: 1.6rem; font-weight: 700; margin: .5rem 0 1rem; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.hint { font-size: .88rem; color: var(--muted); margin: -.15rem 0 .4rem; }
input[type=text], input[type=email], input[type=password], input:not([type]), textarea, select {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  border: 1px solid #cfccc3; border-radius: 10px; padding: 12px 14px; background: #fff; min-height: var(--tap);
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(8, 89, 63, .25); border-color: var(--accent); }
input:disabled, textarea:disabled { background: #f4f3ee; color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 18px; border: 1px solid #cfccc3; border-radius: 99px; background: #fff; font-weight: 500; cursor: pointer; }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid rgba(8, 89, 63, .3); }
.check { display: flex; gap: .6rem; align-items: center; min-height: 40px; }
.check input { width: 22px; height: 22px; }

.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); border-radius: 12px;
  min-height: var(--tap); padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn.secondary { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.big { width: 100%; min-height: 56px; font-size: 1.05rem; margin: .5rem 0 1rem; }
.btn[disabled] { opacity: .6; }
.link-btn { appearance: none; background: none; border: 0; font: inherit; color: var(--accent); cursor: pointer; padding: 8px 4px; min-height: 40px; }
.link-btn.danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.actions .btn { flex: 1 1 140px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, #fff 75%, rgba(255,255,255,0)); padding: 16px 0 calc(12px + env(safe-area-inset-bottom)); margin-bottom: -8px; }
.changes-form { margin-top: 1.4rem; display: flex; flex-direction: column; gap: 10px; }
.changes-form label { font-weight: 600; }
.inline { display: inline; }

.upload { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; border: 2px dashed #c9c6bc; border-radius: var(--radius); padding: 26px 16px; background: #fbfaf7; cursor: pointer; min-height: 120px; }
.dropzone.has-files { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-title { font-weight: 600; color: var(--accent); }
.dz-sub { font-size: .88rem; color: var(--muted); }
.upload-status { font-size: .92rem; color: var(--accent); font-weight: 600; }

.files { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.files li { background: #fbfaf7; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.files img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #eee; }
.file-icon { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); background: #efede7; }
.file-meta { padding: 8px 10px 4px; display: flex; flex-direction: column; font-size: .85rem; word-break: break-word; }
.files form { padding: 0 6px 4px; }

.entries { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.entry { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fdfcfa; }
.entry header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.entry h3 { margin: 0; }
dl { margin: .6rem 0; display: grid; grid-template-columns: 1fr; gap: 2px 16px; }
dt { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
dd { margin: 0; }
@media (min-width: 700px) { dl { grid-template-columns: minmax(140px, 1fr) 2fr; } dt { margin-top: 0; } }
.add-entry > summary { list-style: none; width: 100%; }
.add-entry > summary::-webkit-details-marker { display: none; }
.add-entry[open] > summary { margin-bottom: 16px; }

.comments { max-width: 46rem; margin: 0 auto; }
.task + .comments { padding: 0 4px; }
.thread { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.thread li { border-radius: 12px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); }
.thread li.from-admin { background: var(--amber-soft); border-color: transparent; }
.who { font-size: .8rem; color: var(--muted); font-weight: 600; }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea { min-height: 70px; }
.comment-form .btn { align-self: flex-start; }

/* Admin */
.admin-tasks { display: flex; flex-direction: column; gap: 0; }
.admin-task { padding: 0; margin: 8px 0; }
.admin-task > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; min-height: 64px; }
.admin-task > summary::-webkit-details-marker { display: none; }
.admin-task.is-new { border-left: 4px solid var(--blue); }
.num { width: 28px; height: 28px; border-radius: 50%; background: #eeece6; display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: 0 0 28px; }
.admin-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-form input { width: auto; flex: 1 1 220px; }
.edit summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.copy-row input { flex: 1; font-size: 14px; }
.inline-form { margin-top: 1rem; max-width: 46rem; }
.activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.entries-send { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Wide pages (tour) */
.wrap.wide { max-width: 1180px; }

/* Tour card on the dashboard */
.tour-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0 8px; }
.tour-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.tour-card-head h2 { margin: 0 0 .2rem; }
.tour-card-head .btn { flex: 0 0 auto; }
.tour-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tour-list a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 6px; border-radius: 99px; border: 1px solid var(--line); background: #fbfaf7; color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500; }
.tour-list .n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfccc3; display: grid; place-items: center; font-size: .8rem; color: #fff; }
.tour-list .seen .n { background: var(--accent); border-color: var(--accent); }
.tour-list .seen a { color: var(--muted); }
