/* Area "contrib" (docs/V2_BUILD.md). Only this area edits this file.
   Suggestion and correction forms, moderation screens, leaderboard, badges, contributions.
   Tokens of tokens.css only: flat rules and rows, no card, no shadow, no pill, no tile. */

/* Page layout ---------------------------------------------------------------- */
.hsm-c-head { position: relative; margin-top: 40px; max-width: 900px; }
.hsm-c-lead { max-width: 720px; margin: 16px 0 0; }
.hsm-c-steps { display: block; margin-top: 28px; color: var(--hsm-muted); }
.hsm-c-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; margin-top: 48px; align-items: start; }
.hsm-c-layout--wide { grid-template-columns: minmax(0, 1fr) 380px; }
.hsm-c-side { display: grid; gap: 32px; align-content: start; }
.hsm-c-side .hsm-c-quiet, .hsm-c-form > .hsm-btn, .hsm-c-form > .hsm-c-quiet { justify-self: start; }
.hsm-c-section { margin-top: 56px; }
.hsm-c-section:first-child { margin-top: 0; }
.hsm-c-section > .hsm-label { margin-bottom: 24px; }
@media (max-width: 900px) {
  .hsm-c-layout, .hsm-c-layout--wide { grid-template-columns: minmax(0, 1fr); gap: 48px; }
}

/* Forms ------------------------------------------------------------------------ */
.hsm-c-form { display: grid; gap: 24px; }
.hsm-c-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hsm-c-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hsm-c-span { grid-column: 1 / -1; }
@media (max-width: 800px) { .hsm-c-grid, .hsm-c-grid--3 { grid-template-columns: minmax(0, 1fr); } }
/* contrib.css is loaded on every page: every rule below is scoped to the area's classes. */
.hsm-c-form .hsm-field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.hsm-c-form .hsm-field input[type="file"] { padding: 12px 16px; color: var(--hsm-muted); }
.hsm-c-form .hsm-field input[type="file"]::file-selector-button {
  margin-right: 16px; padding: 8px 12px; border: 0; border-radius: 0; background: var(--hsm-ink); color: var(--hsm-text);
  font: 600 12px var(--hsm-font); letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
}
.hsm-c-form .hsm-checks input { min-height: 0; padding: 0; }
.hsm-c-help { color: var(--hsm-muted); font-size: 14px; }
.hsm-c-error { color: var(--hsm-coral); font-size: 14px; }
.hsm-c-field--error input, .hsm-c-field--error select, .hsm-c-field--error textarea { outline: 1px solid var(--hsm-coral); }
.hsm-c-errors { margin: 0; padding: 16px 18px; border-left: 4px solid var(--hsm-coral); background: var(--hsm-field); font-size: 14px; list-style: none; }
.hsm-c-errors li + li { margin-top: 6px; }
.hsm-c-check { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.hsm-c-check input, .hsm-c-choice input, .hsm-c-table input[type="checkbox"] { accent-color: var(--hsm-coral); width: 16px; height: 16px; flex: none; }
.hsm-c-actions { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; margin-top: 8px; }
.hsm-c-fieldset { margin: 40px 0 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 16px; }
.hsm-c-fieldset > legend { padding: 0; margin-bottom: 12px; }

/* Venue picker: results of the htmx search, then "new" and "not announced" */
.hsm-c-choices { display: grid; border-top: 1px solid var(--hsm-rule); }
.hsm-c-choice { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--hsm-rule); font-size: 14px; cursor: pointer; }
.hsm-c-choice:hover { color: var(--hsm-white); }
.hsm-c-choice strong { font-weight: 600; color: var(--hsm-white); }
.hsm-c-new { padding: 8px 0 20px 30px; border-bottom: 1px solid var(--hsm-rule); }
#venue-results .hsm-c-help { margin: 12px 0; }

/* Quiet button: secondary actions (quick flags, "fill by hand", filters) */
.hsm-c-quiet {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--hsm-muted); border-radius: 0;
  background: none; color: var(--hsm-text); font: 600 12px/1 var(--hsm-font); letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.hsm-c-quiet:hover { border-color: var(--hsm-white); color: var(--hsm-white); }
.hsm-c-quiet[aria-pressed="true"] { border-color: var(--hsm-white); color: var(--hsm-white); }

/* Event page hook: added by, report, flags ---------------------------------------- */
.hsm-c-report { display: grid; gap: 14px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--hsm-rule); max-width: 1100px; }
.hsm-c-credits { margin: 0; color: var(--hsm-muted); font-size: 14px; }
.hsm-c-credits a { color: var(--hsm-text); text-decoration: none; font-weight: 600; }
/* Staff line on the event page: last check, edit, mark checked (a button drawn as a link). */
.hsm-c-staff { margin: 8px 0 0; font-size: 14px; color: var(--hsm-muted); }
.hsm-c-linkbutton { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.hsm-c-credits a:hover { text-decoration: underline; }
.hsm-c-flags { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.hsm-c-flags form { margin: 0; }
.hsm-c-flags .hsm-overline { margin-right: 8px; color: var(--hsm-muted); }
.hsm-c-flags p { flex-basis: 100%; margin: 4px 0 0; }

/* Tabs and filters --------------------------------------------------------------- */
.hsm-c-tabs { display: flex; flex-wrap: wrap; gap: 8px 36px; margin-top: 40px; border-bottom: 1px solid var(--hsm-rule); }
.hsm-c-tabs a {
  margin-bottom: -1px; padding: 0 0 14px; border-bottom: 2px solid transparent; color: var(--hsm-muted);
  font: 600 13px var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; text-decoration: none;
}
.hsm-c-tabs a:hover { color: var(--hsm-white); }
.hsm-c-tabs a[aria-current="page"] { color: var(--hsm-white); border-bottom-color: var(--hsm-coral); }
.hsm-c-filters { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-top: 24px; font-size: 14px; }
.hsm-c-filters a { color: var(--hsm-muted); text-decoration: none; }
.hsm-c-filters a:hover, .hsm-c-filters a[aria-current="true"] { color: var(--hsm-white); text-decoration: underline; text-underline-offset: 4px; }
.hsm-c-filters form { display: flex; gap: 12px; align-items: center; }
.hsm-c-filters select { min-height: 40px; padding: 0 12px; border: 0; border-radius: 0; background: var(--hsm-field); color: var(--hsm-text); font: 400 14px var(--hsm-font); }

/* Dense tables (back-office): rule lines, overline headers ------------------------- */
.hsm-c-table { width: 100%; margin-top: 24px; border-collapse: collapse; font-size: 14px; }
.hsm-c-table th {
  padding: 0 20px 12px 0; border-bottom: 1px solid var(--hsm-rule); text-align: left; vertical-align: bottom;
  color: var(--hsm-muted); font: 600 12px/1.4 var(--hsm-font); letter-spacing: var(--hsm-track); text-transform: uppercase;
}
.hsm-c-table td { padding: 16px 20px 16px 0; border-bottom: 1px solid var(--hsm-rule); vertical-align: top; overflow-wrap: anywhere; }
.hsm-c-table tbody tr:hover { background: color-mix(in srgb, var(--hsm-white) 3%, transparent); }
.hsm-c-table a { text-decoration: none; }
.hsm-c-table a:hover { text-decoration: underline; }
.hsm-c-table .hsm-c-num { text-align: right; white-space: nowrap; padding-right: 0; }
.hsm-c-table .hsm-c-tick { width: 32px; }
.hsm-c-name { display: block; color: var(--hsm-white); font: 600 15px/1.3 var(--hsm-font-wide); letter-spacing: 1.5px; text-transform: uppercase; }
.hsm-c-sub { display: block; margin-top: 4px; color: var(--hsm-muted); font-size: 13px; }
.hsm-c-empty { margin: 32px 0 0; color: var(--hsm-muted); }
@media (max-width: 800px) {
  .hsm-c-table thead { display: none; }
  .hsm-c-table, .hsm-c-table tbody, .hsm-c-table tr, .hsm-c-table td { display: block; width: 100%; }
  .hsm-c-table tr { position: relative; padding: 16px 0; border-bottom: 1px solid var(--hsm-rule); }
  .hsm-c-table td { padding: 4px 0; border: 0; overflow: hidden; }
  .hsm-c-table td:first-child { padding-right: 36px; }
  .hsm-c-table td[data-label]::before {
    content: attr(data-label); float: left; width: 104px; margin: 2px 12px 0 0; color: var(--hsm-muted);
    font: 600 11px/1.4 var(--hsm-font); letter-spacing: 1.5px; text-transform: uppercase;
  }
  .hsm-c-table .hsm-c-num { text-align: left; }
  .hsm-c-table .hsm-c-nil { display: none; }
  .hsm-c-table .hsm-c-tick { position: absolute; right: 0; top: 18px; width: auto; }
}

/* Diff: before struck through, after in white ---------------------------------------- */
.hsm-c-before { color: var(--hsm-muted); text-decoration: line-through; text-decoration-color: var(--hsm-muted); }
.hsm-c-after { color: var(--hsm-white); }
.hsm-c-kind { color: var(--hsm-muted); font: 600 11px var(--hsm-font); letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; }
.hsm-c-notes { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; }
.hsm-c-notes li { padding-left: 16px; border-left: 2px solid var(--hsm-muted); }
.hsm-c-notes--ask li { border-left-color: var(--hsm-coral); color: var(--hsm-white); }

/* Facts: label / value pairs ------------------------------------------------------------ */
.hsm-c-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0; font-size: 14px; }
.hsm-c-facts dt { color: var(--hsm-muted); font: 600 12px/1.6 var(--hsm-font); letter-spacing: 2px; text-transform: uppercase; }
.hsm-c-facts dd { margin: 0; overflow-wrap: anywhere; }
.hsm-c-facts a { text-decoration: none; }
.hsm-c-facts a:hover { text-decoration: underline; }
.hsm-c-lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hsm-rule); font-size: 14px; }
.hsm-c-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hsm-rule); overflow-wrap: anywhere; }
.hsm-c-lines li > :first-child { min-width: 0; }
.hsm-c-lines li > :last-child:not(:first-child) { flex: none; white-space: nowrap; text-align: right; }
.hsm-c-lines a { text-decoration: none; }
.hsm-c-lines a:hover { text-decoration: underline; }
.hsm-c-poster { width: 220px; transform: rotate(var(--hsm-poster-tilt)); }
.hsm-c-json { margin-top: 32px; font-size: 13px; }
.hsm-c-json summary { cursor: pointer; color: var(--hsm-muted); }
.hsm-c-json pre { overflow-x: auto; padding: 16px; background: var(--hsm-black); color: var(--hsm-text); font-size: 12px; line-height: 1.5; }
.hsm-c-status { color: var(--hsm-muted); }
.hsm-c-status--approved, .hsm-c-status--applied { color: var(--hsm-white); }

/* Leaderboard rows: rank, contributor, points aligned right ------------------------------- */
.hsm-c-board { margin: 32px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--hsm-rule); }
.hsm-c-board li { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--hsm-rule); }
.hsm-c-board li[aria-current="true"] { padding-left: 16px; border-left: 4px solid var(--hsm-coral); }
.hsm-c-rank { color: var(--hsm-muted); font: 600 30px/1 var(--hsm-font-wide); letter-spacing: var(--hsm-track); }
.hsm-c-board li:nth-child(-n+3) .hsm-c-rank { color: var(--hsm-white); }
.hsm-c-who { display: block; color: var(--hsm-white); font: 600 24px/1.15 var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; text-decoration: none; overflow-wrap: anywhere; }
a.hsm-c-who:hover { text-decoration: underline; }
.hsm-c-points { text-align: right; }
.hsm-c-points strong { display: block; color: var(--hsm-white); font: 600 30px/1 var(--hsm-font-wide); letter-spacing: var(--hsm-track); }
.hsm-c-period { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; margin-top: 24px; }
.hsm-c-month { display: flex; gap: 20px; align-items: baseline; }
.hsm-c-month strong { color: var(--hsm-white); font: 600 20px var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; }
.hsm-c-month a { color: var(--hsm-muted); font-size: 14px; text-decoration: none; }
.hsm-c-month a:hover { color: var(--hsm-white); }
@media (max-width: 800px) {
  .hsm-c-board li { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; padding: 18px 0; }
  .hsm-c-rank, .hsm-c-points strong { font-size: 20px; }
  .hsm-c-who { font-size: 16px; }
}

/* Level line (my contributions, profile) ---------------------------------------------- */
.hsm-c-level { display: flex; flex-wrap: wrap; gap: 8px 40px; align-items: baseline; margin-top: 24px; }
.hsm-c-level strong { color: var(--hsm-white); font: 600 40px/1.05 var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; }
.hsm-c-badges { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hsm-rule); }
.hsm-c-badges li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding: 18px 0; border-bottom: 1px solid var(--hsm-rule); }
.hsm-c-badges .hsm-c-name { font-size: 18px; }
.hsm-c-badges p { margin: 0; color: var(--hsm-muted); font-size: 14px; }
.hsm-c-badges .hsm-c-num { text-align: right; font-size: 14px; }
.hsm-c-badge--locked .hsm-c-name { color: var(--hsm-muted); }
@media (max-width: 800px) { .hsm-c-level strong { font-size: 26px; } .hsm-c-badges li { grid-template-columns: minmax(0, 1fr); } .hsm-c-badges .hsm-c-num { text-align: left; } }

/* Public profile hook ------------------------------------------------------------------- */
.hsm-c-profile { margin-top: var(--hsm-gap); }
.hsm-c-profile .hsm-c-level strong { font-size: 30px; }
.hsm-c-inline { margin: 16px 0 0; color: var(--hsm-muted); font-size: 14px; }
.hsm-c-inline strong { color: var(--hsm-text); font-weight: 600; }

/* Spacing helper, last so that it wins over the margin resets above. */
.hsm-c-gap { margin-top: 32px; }
.hsm-c-head .hsm-h1 a { text-decoration: none; }
.hsm-c-head .hsm-h1 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
