/* Integra — post tracker (tracker.html). Mobile-first, single column, 480px max. */

[hidden] { display: none !important; }

/* --row-hover lives in tokens.css so the wash follows the theme (#F3F3F6 light
   / #1E1D25 dark). Redeclaring it here would pin this page to the light value,
   since this sheet loads after tokens.css. */

::selection { background: var(--blurple); color: var(--accent-ink); }

/* Subtle page-load fade — opacity only, gated on motion preference. */
@media (prefers-reduced-motion: no-preference) {
  body { animation: tracker-page-in 150ms var(--ease); }
  @keyframes tracker-page-in { from { opacity: 0; } }
}

.tracker-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */

.tracker-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

/* The chrome is sized to the page, not to the 480px form column: at 1100px it
   matches the admin board and the setup page exactly, so the wordmark holds its
   position as staff move between them instead of sliding toward the middle.
   min-height pins the bar at 41px + --s4 twice = 73px under the 1px hairline
   (border-box, so the min-height carries the padding). 41px is a .btn-sm's own
   height — the size the dashboard and admin headers take from their buttons —
   so this header measures the same 74px without carrying any. */
.tracker-header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s4) var(--s5);
  min-height: calc(41px + var(--s4) * 2);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.lockup-link { display: inline-flex; align-items: center; }
/* One height for both themes: light and dark ship the same 1080×267 badged
   lockup, so the identity never moves or changes size across a theme flip. */
.lockup { height: 28px; width: auto; display: block; }

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--rule);
  flex: none;
}

/* Chrome, held at the right edge of the header row. */
.tracker-header .theme-toggle { margin-left: auto; }

/* ---- Main column ---- */

.tracker-main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s8);
}

.page-title {
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 0 0 var(--s2);
}

.page-sub {
  font-size: 14px;
  margin: 0 0 var(--s6);
}

.creator-note {
  color: var(--graphite);
  font-size: 14px;
  margin: 0 0 var(--s6);
}

/* ---- Form ---- */

.field { margin-bottom: var(--s5); }

.field > label {
  font-size: 14px;
  font-weight: 500;
}

.optional {
  color: var(--graphite);
  font-weight: 400;
}

/* Larger touch targets; ≥16px stops mobile browsers zooming the field on focus. */
.tracker-main input,
.tracker-main select,
.tracker-main textarea {
  font-size: 16px;
}

.tracker-main textarea { resize: vertical; }

/* The URL field's example is mono at 16px; at 420px and under it steps to 13px
   so the string ends at the ellipsis it was written with instead of being cut
   mid-word against the field border. */
@media (max-width: 420px) {
  #post-url::placeholder { font-size: 13px; }
}

/* The chip's slot is reserved whether or not a platform has been detected:
   28px chip + its --s2 top margin = 36px, so typing a URL reveals the chip
   without moving the account, caption, and time fields underneath it.
   flex (not block) so the chip's margin cannot collapse into the slot and no
   line-box strut can make an empty slot and a filled one differ. */
.chip-slot {
  display: flex;
  align-items: flex-start;
  min-height: 36px;
}

/* Detected platform — label-on-hairline: mono label, 1px rule border, no fill. */
.platform-chip {
  display: inline-block;
  margin-top: var(--s2);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--graphite);
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s1) var(--s2);
}

.field-error {
  color: var(--fault-text);
  font-size: 12px;
  margin: var(--s2) 0 0;
}

/* Mono echo of the Posted field, in the record's own format. Its height is
   reserved (12px copy at line-height 1.6), so clearing the field does not move
   the counts below it. */
.posted-echo {
  margin: var(--s2) 0 0;
  min-height: 20px;
  font-size: 12px;
  color: var(--graphite);
}

/* Counts stack below 360px; one row of three from 360px up. Measured: a 390px
   phone gives each column 106px and a 360px one 96px — both hold a 6-figure
   mono count like 18,402 at 16px, and the COMMENTS label at 70px. */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
  border: 0;
  padding: 0;
  margin: 0 0 var(--s5);
  min-width: 0;
}

.metric-field { min-width: 0; }
.metric-field input { padding: 12px 10px; }

/* Full-width submit below 360px; inline with the confirmation from 360px up. */
.submit-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s3);
  margin-top: var(--s6);
}

#submit-btn { width: 100%; }

@media (min-width: 360px) {
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
  .submit-row {
    flex-direction: row;
    align-items: center;
    gap: var(--s4);
  }
  #submit-btn { width: auto; }
}

.confirm-note {
  color: var(--graphite);
  font-size: 13px;
}

/* "Logged HH:MM" fades in — opacity only, gated on motion preference. */
@media (prefers-reduced-motion: no-preference) {
  .confirm-note.is-shown { animation: confirm-in 120ms var(--ease); }
  @keyframes confirm-in { from { opacity: 0; } }
}

/* ---- Recent logs ---- */

.recent { margin-top: var(--s8); }

/* Carries the same --s2 bleed as the rows below, so the label's hairline and
   every row hairline start and end on the same two verticals. Text alignment is
   unchanged — the padding gives back exactly what the margin took. */
.recent-title {
  display: block;
  margin: 0 calc(-1 * var(--s2));
  padding: 0 var(--s2) var(--s3);
  border-bottom: 1px solid var(--rule);
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Rows share the dashboard feed hover: --row-hover, 150ms. Fill bleeds --s2
   past the text edge via the negative margin; text alignment is unchanged. */
.log-row {
  padding: var(--s4) var(--s2);
  margin: 0 calc(-1 * var(--s2));
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--t-fast) var(--ease);
}
.log-row:hover { background-color: var(--row-hover); }

.log-top {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.log-glyph {
  display: inline-flex;
  color: var(--ink);
  flex: none;
}

.log-glyph svg {
  width: 16px;
  height: 16px;
  display: block;
}

.log-handle {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-stamp {
  margin-left: auto;
  color: var(--graphite);
  font-size: 12px;
  flex: none;
}

.log-caption {
  font-size: 14px;
  line-height: 1.5;
  margin: var(--s2) 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.log-meta {
  margin-top: var(--s2);
  font-size: 12px;
  color: var(--graphite);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--s3);
  row-gap: var(--s1);
}

/* "view ↗" is held at the row's right edge, directly under the timestamp, so
   the links read as a column instead of starting wherever each row's counts
   happen to end. */
.log-meta a { margin-left: auto; }

/* ---- Footer ---- */

.tracker-footer { border-top: 1px solid var(--rule); }

/* Same 1100px chrome width as the header above, so the footer mark sits on the
   same vertical as the wordmark. */
.tracker-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s4) var(--s5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tracker-footer .tagline { margin: 0; }
.tracker-footer img { display: block; width: 16px; height: 16px; }

/* ---- Wider screens ---- */

@media (min-width: 600px) {
  .tracker-main { padding-top: var(--s7); }
}
