:root {
  --pico-primary: #2f6f4f;
  --pico-primary-background: #2f6f4f;
  --pico-primary-border: #2f6f4f;
  --pico-primary-hover: #245a3f;
  --pico-primary-hover-background: #245a3f;
  --pico-font-size: 100%;
  --ok: #2f6f4f;
  --warn: #a15c00;
  --bad: #b3261e;
  --muted-bg: rgba(127, 127, 127, 0.08);
}

body { padding-bottom: 4.5rem; }
main.container { padding-top: 1rem; }
h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-top: 1.75rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }

/* --- Top bar / navigation --- */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 1rem; border-bottom: 1px solid var(--pico-muted-border-color);
  position: sticky; top: 0; z-index: 10; background: var(--pico-background-color);
}
.topbar .brand { font-weight: 700; text-decoration: none; font-size: 1.15rem; }
.topbar .account { margin-left: auto; font-size: 0.9rem; }
.mainnav { display: flex; gap: 1rem; }
.mainnav a { text-decoration: none; color: var(--pico-muted-color); }
.mainnav a[aria-current="page"] { color: var(--pico-primary); font-weight: 600; }

@media (max-width: 720px) {
  .mainnav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    justify-content: space-around; gap: 0;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    background: var(--pico-background-color);
    border-top: 1px solid var(--pico-muted-border-color);
  }
  .mainnav a { font-size: 0.85rem; padding: 0.35rem 0.5rem; }
}
@media (min-width: 721px) { body { padding-bottom: 1rem; } }

/* --- Flash messages --- */
.flash { padding: 0.75rem 1rem; border-radius: var(--pico-border-radius); margin-bottom: 1rem;
         background: var(--muted-bg); border-left: 4px solid var(--pico-primary); }
.flash-error { border-left-color: var(--bad); }
.flash-warning { border-left-color: var(--warn); }

/* --- Badges --- */
.badge { display: inline-block; font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 999px;
         background: var(--muted-bg); border: 1px solid var(--pico-muted-border-color);
         white-space: nowrap; vertical-align: middle; }
.badge.blocked { color: var(--bad); border-color: var(--bad); }
.badge.chosen { color: var(--ok); border-color: var(--ok); font-weight: 600; }
.badge.high { color: var(--bad); }
.badge.low { opacity: 0.7; }
.badge.status-done { color: var(--ok); }
.badge.status-in_progress { color: var(--warn); }
.badge.status-cancelled { text-decoration: line-through; opacity: 0.7; }

/* --- Lists & cards --- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: 0.75rem; margin: 0.75rem 0 1rem; flex-wrap: wrap; }
.tabs a { text-decoration: none; }
.tabs a[aria-current="page"] { font-weight: 700; text-decoration: underline; }

.cards { list-style: none; padding: 0; margin: 0; }
.cards > li { list-style: none; padding: 0.75rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.cards > li:last-child { border-bottom: 0; }
.cards a.title { font-weight: 600; text-decoration: none; }
.meta { font-size: 0.85rem; color: var(--pico-muted-color); display: flex; gap: 0.5rem;
        flex-wrap: wrap; align-items: center; margin-top: 0.2rem; }
.muted { color: var(--pico-muted-color); }
.small { font-size: 0.85rem; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

article.option { padding: 1rem; margin-bottom: 1rem; }
article.option.is-chosen { border: 2px solid var(--pico-primary); }
.option-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.option-total { font-size: 1.15rem; font-weight: 700; }

.blocked-box { border-left: 4px solid var(--bad); padding: 0.5rem 1rem; background: var(--muted-bg);
               border-radius: var(--pico-border-radius); margin: 0.75rem 0; }

/* --- Forms --- */
.inline-form { display: inline; margin: 0; }
.inline-form button, button.link { all: unset; cursor: pointer; color: var(--pico-primary);
  font-size: 0.85rem; text-decoration: underline; }
button.link.danger, .inline-form button.danger { color: var(--bad); }
.row { display: grid; gap: 0 0.75rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
details.add > summary { color: var(--pico-primary); }
details.add { margin: 0.75rem 0; }
.actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.actions > * { margin-bottom: 0; }
.danger-zone { margin-top: 2.5rem; }
.danger-zone button { background: var(--bad); border-color: var(--bad); }

/* --- Tables on phones --- */
.table-wrap { overflow-x: auto; }
table { font-size: 0.92rem; }
table td, table th { padding: 0.4rem 0.5rem; }

/* --- Attachments --- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.75rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--pico-border-radius); }
.gallery .doc { display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
                background: var(--muted-bg); border-radius: var(--pico-border-radius);
                font-size: 0.8rem; padding: 0.5rem; text-align: center; word-break: break-word; }
.gallery figcaption { font-size: 0.75rem; margin-top: 0.2rem; }

pre.notes { white-space: pre-wrap; font-family: inherit; background: none; padding: 0; margin: 0; }
