/* Mayfly app styles. Tokens come from tokens.css — nothing here invents a colour. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 34rem; margin: 0 auto; padding: var(--space-4) var(--space-4) 6rem; }

/* ---------------------------------------------------------------------- bar */

.bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding-bottom: var(--space-4);
}
.brand {
  font-size: var(--step-2); font-weight: 600; margin: 0;
  letter-spacing: -0.02em;
}
.search {
  flex: 1; min-height: var(--hit);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius-chip);
  padding: 0 var(--space-4); font: inherit;
}
.search::placeholder { color: var(--ink-faint); }
.search:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* -------------------------------------------------------------------- tray */

.tray {
  width: 100%; text-align: left; margin-bottom: var(--space-4);
  background: var(--accent-sunk); color: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4); font: inherit; min-height: var(--hit);
}

/* ------------------------------------------------------------------- items */

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }

.card {
  display: grid; grid-template-columns: 3.5rem 1fr auto;
  align-items: center; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-card); padding: var(--space-3);
  min-height: var(--hit); cursor: pointer;
}
.thumb {
  width: 3.5rem; height: 3.5rem; border-radius: 8px;
  background: var(--surface-raised); object-fit: cover;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.meta { display: grid; gap: 2px; min-width: 0; }
.label {
  font-size: var(--step-0); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.left {
  font-family: var(--font-num); font-size: var(--step--1);
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
}

.ring { width: 28px; height: 28px; flex: none; }
.ring .track { stroke: var(--rule-strong); }
.ring .fill { stroke: var(--accent); }
.ring[data-band='warn'] .fill { stroke: var(--warn); }
.ring[data-band='urgent'] .fill { stroke: var(--urgent); }

.empty {
  color: var(--ink-soft); text-align: center;
  padding: var(--space-12) var(--space-4);
}

/* ------------------------------------------------------------------ shutter */

.shutter-fab {
  position: fixed; right: max(var(--space-6), env(safe-area-inset-right));
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  width: 4.25rem; height: 4.25rem; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.35);
}
.fab-dot {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--ground);
}

/* --------------------------------------------------------------- viewfinder */

.capture { display: grid; gap: var(--space-4); }
.viewfinder {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  background: #000; border-radius: var(--radius-card);
}
.status { color: var(--ink-soft); font-size: var(--step--1); text-align: center; margin: 0; }
.capture-bar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: var(--space-4);
}
.shutter {
  width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: var(--accent); border: 4px solid var(--surface); cursor: pointer;
  justify-self: center;
}

/* --------------------------------------------------------------- tag sheet */

.sheet-wrap {
  position: fixed; inset: 0; display: grid; align-content: end;
  background: rgb(0 0 0 / 0.45); padding: var(--space-3);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
}
.sheet {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sheet); padding: var(--space-4);
  display: grid; gap: var(--space-3);
  max-height: 90vh; overflow-y: auto;
}
.sheet h2 { margin: 0; font-size: var(--step-2); }
.hint { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }
.presets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.preset {
  width: 100%; text-align: left; min-height: var(--hit);
  display: grid; gap: 2px;
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4); font: inherit; cursor: pointer;
}
.preset[data-preset='keep'] { border-color: var(--keep); }
.preset-label { font-weight: 500; }
/* The consequence is not decoration: not knowing what you agreed to is the
   feeling people dislike most about software that deletes things. */
.preset-consequence {
  font-family: var(--font-num); font-size: var(--step--1); color: var(--ink-soft);
}
.preset[data-preset='keep'] .preset-consequence { color: var(--keep); }

/* ------------------------------------------------------------------ actions */

.full { width: 100%; border-radius: var(--radius-card); background: var(--surface); }
.gone {
  padding: var(--space-12) var(--space-4); text-align: center; color: var(--ink-soft);
  background: var(--surface); border-radius: var(--radius-card);
}
.actions { display: flex; gap: var(--space-2); padding-top: var(--space-4); }

button.ghost {
  min-height: var(--hit); padding: 0 var(--space-4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius-chip);
  font: inherit; cursor: pointer;
}
button.ghost.wide { width: 100%; }
button.ghost.danger { color: var(--urgent); border-color: var(--urgent); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------- onboarding */

.onboard { display: grid; gap: var(--space-4); padding-top: var(--space-6); }
.dots { display: flex; gap: var(--space-2); justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rule-strong); }
.dot.on { background: var(--accent); }

.card-page { display: grid; gap: var(--space-3); }
.card-page h2 { margin: 0; font-size: var(--step-3); line-height: 1.15; }
.card-page p { margin: 0; color: var(--ink-soft); }
.warn-note {
  border-left: 3px solid var(--warn); padding-left: var(--space-3);
  color: var(--ink) !important;
}

.onboard-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
button.primary {
  min-height: var(--hit); padding: 0 var(--space-6);
  background: var(--accent); color: var(--ground);
  border: none; border-radius: var(--radius-chip);
  font: inherit; font-weight: 600; cursor: pointer;
}

.install {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-card); padding: var(--space-3) var(--space-4);
}
.install summary { cursor: pointer; min-height: var(--hit); display: flex; align-items: center; }
.install ol { margin: var(--space-2) 0; padding-left: 1.25rem; color: var(--ink-soft); }
.install li { margin-bottom: var(--space-2); }

/* No urgency anywhere in acquisition: urgency is the phishing tell people are
   trained to spot, and this app is asking for a lot of trust up front. */
.provenance { display: grid; gap: var(--space-2); }
.provenance p {
  margin: 0; font-size: var(--step--1); color: var(--ink-faint); max-width: 42ch;
}
.foot { padding-top: var(--space-12); }

/* ---------------------------------------------------------- expiring soon */

.soon {
  background: var(--surface); border: 1px solid var(--warn);
  border-radius: var(--radius-card); padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.soon-head { margin: 0 0 var(--space-2); color: var(--warn); font-weight: 500; }
.soon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.soon-list li {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
}
.soon-list li > span:first-child { flex: 1; min-width: 8ch; }
button.ghost.small { min-height: 2.25rem; padding: 0 var(--space-3); font-size: var(--step--1); }

.field { display: grid; gap: var(--space-2); padding-top: var(--space-4); }
.field > span { font-size: var(--step--1); color: var(--ink-soft); }
.field .search { width: 100%; }
