/*
  The claim page (/claim/), design v3. Layout for this page only; card, rows, badges, kvrows,
  callouts, learn, states, steps and the sheet come from ui.css. Loaded by the
  <!-- style: /assets/page-claim.css --> marker in pages/claim.html and pages/zh/claim.html.

  Phone: the summary card, a closed "how a claim works", one row per broker (the amount and a
  compact claim button on the right), then a closed "check it yourself". From 900px the summary
  puts its counts beside the total, and the rows line up as a table under a column head.
*/

/* The head (.pagehead) and its lead take their margins from the shared page head in ui.css. */

/* ---- summary */

.cl-sum-label {
  margin: 0;
  font-size: var(--fs-sm);
  letter-spacing: 0;
}
.cl-total {
  margin: var(--s1) 0 0;
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.cl-total .cl-unit {
  font-size: var(--fs-xl);
  letter-spacing: -0.01em;
}
.cl-total.is-unknown {
  color: var(--amber);
}
.cl-total .skel-fig {
  height: 34px;
}
.cl-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: var(--s4) 0 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--hair);
}
.cl-stat {
  min-width: 0;
  margin: 0;
  padding: 0 var(--s4);
  border-left: 1px solid var(--hair);
}
.cl-stat:first-child {
  padding-left: 0;
  border-left: 0;
}
.cl-stat-fig {
  margin: var(--s0) 0 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cl-stat-fig .skel-line {
  width: 40px;
  margin-top: var(--s2);
}
.cl-reading .spin {
  width: 16px;
  height: 16px;
  margin-top: var(--s0);
}
.cl-sum > .note,
.cl-sum > .why {
  margin-top: var(--s3);
}

.cl-alert {
  margin-top: var(--s3);
}
.cl-alert p {
  margin: 0 0 var(--s2);
}
.cl-alert .cl-alert-title {
  font-weight: 700;
  margin-bottom: var(--s0);
}

.cl-learn {
  margin-top: var(--s3);
}
.cl-verify {
  margin-top: var(--s6);
}

/* ---- broker rows */

.cl-section {
  margin-top: var(--s6);
}
.cl-list-root > .state {
  margin-top: var(--s6);
}
.cl-colhead {
  display: none;
}
.cl-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* A row is a small grid: name and addresses on the left, the amount over the button on the
   right, and any reason under both. */
.row.cl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main owed"
    "main act"
    "note note";
  column-gap: var(--s3);
  row-gap: var(--s2);
  align-items: start;
  padding: var(--s3) var(--s4);
}
.cl-row[data-mine="1"] {
  background: rgba(198, 240, 0, 0.035);
}
.cl-row-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}
.cl-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
}
.cl-name > span:first-child {
  white-space: nowrap;
}
.cl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--s2);
}
.cl-row-owed {
  grid-area: owed;
  text-align: right;
  padding-top: var(--s0);
}
.cl-amt {
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cl-amt.is-mine {
  color: var(--lime);
}
.cl-unit {
  color: var(--text2);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0;
}
.cl-row-act {
  grid-area: act;
  justify-self: end;
}
.cl-row-note {
  grid-area: note;
}
.cl-unread,
.cl-amt.cl-unread {
  color: var(--amber);
}
.cl-zero {
  color: var(--text2);
}
.cl-skelbtn {
  display: block;
  width: 96px;
  height: 36px;
  border-radius: var(--r-sm);
}

.cl-addr {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}
.cl-xlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.cl-xlink:hover {
  text-decoration-color: var(--lime);
}
.cl-xlink svg {
  width: 14px;
  height: 14px;
  color: var(--text2);
}
.cl-contract {
  color: var(--text2);
  font-weight: 600;
}

/* ---- the sheet */

.cl-sheet-sum .cl-unit {
  font-size: var(--fs-lg);
}
.cl-other {
  font-size: var(--fs-sm);
}
.sheet .kvrows .cl-addr {
  justify-content: flex-end;
}

/* ---- check it yourself */

.cl-contracts {
  margin: var(--s4) 0 var(--s4);
}
.cl-contracts > div {
  flex-wrap: wrap;
}
.cl-contracts dd {
  text-align: left;
}
.cl-contracts .addr {
  color: var(--lime);
  text-underline-offset: 3px;
  display: inline-block;
  padding-block: 12px;
  margin-block: -12px;
}

@media (min-width: 900px) {
  .cl-sum {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
    column-gap: var(--s7);
    align-items: end;
  }
  .cl-total {
    font-size: var(--fs-4xl);
  }
  .cl-stats {
    margin: 0;
    padding: 0;
    border-top: 0;
  }
  .cl-stat,
  .cl-stat:first-child {
    padding: 0 0 0 var(--s5);
    border-left: 1px solid var(--hair);
  }
  .cl-sum > .note,
  .cl-sum > .why {
    grid-column: 1 / -1;
  }
  /* The table: one column for the broker and who it pays, then the amount, then the action. */
  .cl-colhead,
  .row.cl-row {
    grid-template-columns: minmax(0, 1fr) 200px 190px;
    column-gap: var(--s5);
  }
  .cl-colhead {
    display: grid;
    padding: 0 var(--s5) var(--s2);
    color: var(--text3);
    font-size: var(--fs-sm);
    font-weight: 600;
  }
  .cl-colhead-owed {
    text-align: right;
  }
  .row.cl-row {
    grid-template-areas:
      "main owed act"
      "note note note";
    align-items: center;
    padding: var(--s3) var(--s5);
    min-height: 64px;
  }
  .cl-row-main {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s1) var(--s5);
  }
  .cl-name {
    min-width: 170px;
  }
  .cl-row-owed {
    padding-top: 0;
  }
  .cl-amt {
    font-size: var(--fs-lead);
  }
}
