/* Great Targets — app styles. Loads after the shared framework.css, so it can
   override the suite tokens (target-red accent, green "hit") and add the target
   cards, sheets and forms this app needs. */

:root {
  --accent: #e5484d;      /* target red — what you're aiming at */
  --accent-dim: #c1373b;
  --hit: #29c46a;         /* green — a target you've hit */
  --hit-soft: rgba(41, 196, 106, 0.12);
  --hit-border: rgba(41, 196, 106, 0.32);
  --danger: #ff6b6b;
}

/* ── Header ─────────────────────────────── */
.wordmark-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.header-accent { color: var(--accent); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.vt-btn {
  width: 34px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.vt-btn.sel { background: var(--bg-hover); color: var(--text); }

.icon-btn.add { color: var(--accent); border-color: rgba(229, 72, 77, 0.4); }
.icon-btn.add:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Filter tabs ────────────────────────── */
.filter-row { display: flex; gap: 8px; margin-top: 10px; }
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Target markers (open rings / hit disc) ─ */
.tgt-marker {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tgt-marker svg { width: 100%; height: 100%; }
.tgt-marker.open { color: var(--accent); }
.tgt-marker.hit { color: var(--hit); }
.tgt-marker.lg { width: 44px; height: 44px; }

/* ── List rows ──────────────────────────── */
.item-list { padding-bottom: 12px; }
.tgt-row.hit .item-title {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.22);
}
.tgt-row.hit .item-sub { color: var(--hit); }

.pill.hit-pill {
  color: var(--hit);
  background: var(--hit-soft);
  border-color: var(--hit-border);
}

/* ── Grid cards ─────────────────────────── */
.item-list.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px 16px 20px;
  align-content: start;
}
.tgt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 122px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, transform 0.05s;
}
.tgt-card:hover { border-color: var(--accent); }
.tgt-card:active { transform: scale(0.98); }
.tgt-card.hit { border-color: var(--hit-border); }
.tgt-card-top { display: flex; align-items: center; justify-content: space-between; }
.tgt-card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.25; overflow-wrap: break-word; }
.tgt-card.hit .tgt-card-title {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.22);
}
.tgt-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.tgt-card-foot { font-size: 0.72rem; color: var(--hit); font-weight: 600; }
.tgt-card-foot:empty { display: none; }

/* ── Empty states ───────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  gap: 6px;
}
.empty-emoji { font-size: 3rem; }
.empty-title { font-size: 1.2rem; font-weight: 600; }
.empty-copy { color: var(--text-muted); max-width: 290px; line-height: 1.5; margin-bottom: 10px; }
.empty-state .visit-btn { width: auto; padding: 12px 22px; }

.filter-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  line-height: 1.5;
}

/* ── Footer counts ──────────────────────── */
.foot-counts { font-variant-numeric: tabular-nums; }

/* ── Scrim + sheets ─────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  max-width: 620px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.open { transform: translateY(0); }

.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 2px auto 12px;
}
.sheet-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  border-radius: 50%;
}
.sheet-close:hover { background: var(--bg-hover); color: var(--text); }
.sheet-title { font-size: 1.2rem; font-weight: 700; overflow-wrap: break-word; word-break: break-word; }

/* ── Detail sheet ───────────────────────── */
.ds-head { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.ds-head-text { flex: 1; min-width: 0; }
.ds-status { font-size: 0.8rem; font-weight: 600; margin-top: 3px; }
.ds-status.open { color: var(--accent); }
.ds-status.hit { color: var(--hit); }
.ds-desc {
  margin-top: 14px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.ds-notes-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.notes-head { display: flex; align-items: center; justify-content: space-between; }
.notes-head .field-label { margin: 0; }
.ds-notes {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.ds-notes.muted { color: var(--text-muted); font-style: italic; }
.ds-hitat { margin-top: 10px; font-size: 0.75rem; color: var(--text-muted); }
.ds-actions { display: flex; gap: 10px; margin-top: 10px; }
.ds-actions .ghost-btn { flex: 1; }

.hit-name { margin-top: 4px; color: var(--text-muted); font-size: 0.95rem; overflow-wrap: break-word; }

/* ── Forms ──────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-hint { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.75; }
.text-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-muted); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.45; }

/* ── Buttons ────────────────────────────── */
.visit-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 14px;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s, background 0.15s;
}
.visit-btn:active { filter: brightness(0.92); }
.visit-btn.accent { background: var(--accent); color: #fff; }

.ghost-btn {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, color 0.15s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-muted); }
.ghost-btn.wide { width: 100%; }
.ghost-btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.3); }
.ghost-btn.danger:hover { border-color: var(--danger); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.danger-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.08);
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Settings summary ───────────────────── */
.set-summary { display: flex; gap: 10px; margin: 16px 0 6px; }
.set-stat {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
}
.set-num { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.set-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.set-section { margin-top: 20px; }
.set-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }

/* ── Sync (settings) ────────────────────── */
.set-label {
  font-size: 0.72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.st-sync { margin: 6px 0 4px; }
.st-sync:empty { display: none; }
.sync-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
}
.sync-state { font-size: 0.8rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghost-btn.sync-off { flex: none; padding: 6px 10px; font-size: 0.72rem; }

/* ── Shake (empty title) ────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.shake { animation: shake 0.35s; border-color: var(--danger) !important; }
