/* Shared parts every page is built from. A page never restyles these; it adds its own classes in views-*.css. */

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px;
  border-radius: var(--r-pill); border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-weight: 600; font-size: .9375rem; white-space: nowrap; transition: background .15s, color .15s, border-color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: rgba(29, 26, 19, .06); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: #33301F; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: #1B3A2E; }
.btn.ghost { border-color: var(--line-strong); background: var(--paper); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.danger { border-color: var(--line-strong); background: var(--paper); color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.big { min-height: 52px; font-size: 1rem; padding: 0 22px; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: var(--t-small); }
.btn[disabled], .btn.busy { opacity: .5; pointer-events: none; }
.btn .i { width: 18px; height: 18px; }
.iconbtn { width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.iconbtn:hover { background: rgba(29, 26, 19, .06); color: var(--ink); }
.link { color: var(--brass-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (pointer: coarse) { .btn.sm { min-height: var(--tap); } }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--paper); color: var(--ink);
    border: 1px solid var(--line-strong);
}
.pill.review { background: var(--brass-ink); border-color: var(--brass-ink); color: #fff; }
.pill.approved, .pill.posted { background: var(--green); border-color: var(--green); color: #fff; }
.pill.feedback { background: var(--brass-soft); border-color: var(--brass); color: var(--ink); }
.pill.denied { background: var(--bad); border-color: var(--bad); color: #fff; }
.pill.quiet { background: transparent; color: var(--muted); }

/* cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.card.pad { padding: var(--s5); }
a.card, button.card { display: block; width: 100%; text-align: left; transition: border-color .15s, box-shadow .2s var(--ease); }
a.card:hover, button.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card h3 + p { margin-top: 4px; color: var(--muted); font-size: var(--t-small); }
.tile, a.card.tile, button.card.tile { display: flex; align-items: center; gap: var(--s3); min-height: 68px; }
.tile .i { width: 22px; height: 22px; color: var(--brass-ink); }
.tile b { display: block; font-weight: 600; }
.tile span { display: block; font-size: var(--t-small); color: var(--muted); }
.tile .chev { margin-left: auto; color: var(--muted); }

/* tabs (a scrolling row of choices) */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); font-weight: 600; font-size: var(--t-small); display: inline-flex;
    align-items: center; gap: 7px;
}
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tabs button b { font-weight: 700; opacity: .75; }
@media (pointer: coarse) { .tabs button { min-height: var(--tap); } }

/* forms */
.field { display: block; }
.field > span { display: block; font-weight: 600; font-size: var(--t-small); margin-bottom: 6px; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: var(--t-small); }
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--paper); font-size: 1rem; line-height: 1.45; transition: border-color .15s, box-shadow .15s;
}
.field textarea, textarea.input { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(150, 118, 42, .22);
}
.field.bad input, .field.bad textarea { border-color: var(--bad); }
.field .err { color: var(--bad); font-weight: 500; }

/* notices */
.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); }
.empty .i { width: 28px; height: 28px; margin: 0 auto var(--s3); color: var(--line-strong); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.note { padding: 10px 14px; border-radius: var(--r-md); background: var(--brass-soft); font-size: var(--t-small); font-weight: 500; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.good { background: var(--green-soft); color: var(--green); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  width: max-content; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: var(--r-md); background: var(--ink); color: var(--bg);
  font-weight: 500; font-size: .9375rem; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5); text-align: center;
}
.toast.bad { background: var(--bad); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* sheet: a panel from the bottom on a phone, a centred box on a wide screen */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; background: var(--paper); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); animation: rise .22s var(--ease);
}
.sheet h2 { margin-bottom: var(--s3); }
.sheet .actions { display: flex; gap: var(--s3); margin-top: var(--s5); }
.sheet .actions .btn { flex: 1; }
.menu a, .menu button {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 52px; padding: 0 var(--s2); border-radius: var(--r-md);
  font-weight: 500; text-align: left;
}
.menu a:hover, .menu button:hover { background: rgba(29, 26, 19, .05); }
.menu .sep { height: 1px; background: var(--line); margin: var(--s2) 0; }
.menu small { margin-left: auto; color: var(--muted); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { border-radius: var(--r-xl); padding: var(--s6); }
}

/* small parts */
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s linear; }
.cover { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-md); overflow: hidden; background: #14110B; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .pill { position: absolute; left: 8px; top: 8px; }
.list > * + * { border-top: 1px solid var(--line); }
img.broken { visibility: hidden; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--ink);
  animation: spin .8s linear infinite; }
.loading { display: grid; place-items: center; min-height: 40dvh; }
@keyframes spin { to { transform: rotate(360deg); } }
