/* Claim page styles. Self-contained (no site CSS, no web fonts) so the folder
   works on its own, e.g. from IPFS. Colours follow the app's palette
   (styled/colors.ts in cache-wallet-app): Cache blue, the card stroke and the
   muted label grey, with the app's dark-mode counterparts. */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1a1b1f;
  --muted: #70738f;
  --stroke: #efefef;
  --brand: #1a3a8a;
  --brand-text: #ffffff;
  --brand-soft: rgba(26, 58, 138, 0.08);
  --ok: #1f8f43;
  --ok-soft: #eaf3e2;
  --warn: #8a6100;
  --warn-soft: #fff6d6;
  --error: #c62828;
  --error-soft: #ffe4e1;
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f12;
    --card: #1a1b1f;
    --text: #f0f0f0;
    --muted: #9fa0b5;
    --stroke: #2a2b32;
    --brand: #3d5db5;
    --brand-soft: rgba(61, 93, 181, 0.18);
    --ok: #5fd07f;
    --ok-soft: rgba(52, 199, 89, 0.14);
    --warn: #ffcc00;
    --warn-soft: rgba(255, 204, 0, 0.12);
    --error: #ff6b6b;
    --error-soft: rgba(239, 68, 68, 0.14);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main, .top, .foot {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 8px;
}

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.top-tag { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; }

h1 { font-size: 28px; line-height: 1.2; margin: 16px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
p { margin: 0 0 8px; }

.intro { padding: 8px 0 16px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 16px;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }

.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }

input[type="text"] {
  font: inherit;
  font-family: var(--mono);
  font-size: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--bg);
  color: var(--text);
}
input[type="text"]:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.toggle { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); margin-top: 12px; }

button {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 11px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.primary { background: var(--brand); color: var(--brand-text); }
.ghost { background: transparent; color: var(--brand); border-color: var(--stroke); }
.chip { background: var(--brand-soft); color: var(--brand); padding: 8px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

a { color: var(--brand); }

.msg { margin: 12px 0 0; font-size: 14px; }
.msg:empty { display: none; }
.msg-ok { color: var(--ok); }
.msg-warn { color: var(--warn); }
.msg-error { color: var(--error); }

.status-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.badge-claimable { background: var(--ok-soft); color: var(--ok); }
.badge-waiting { background: var(--warn-soft); color: var(--warn); }
.badge-recovered { background: var(--brand-soft); color: var(--brand); }
.badge-none { background: var(--stroke); color: var(--muted); }
.badge-blocked { background: var(--error-soft); color: var(--error); }

.countdown { font-size: 22px; font-weight: 700; margin: 4px 0 12px; }

.facts { margin: 12px 0; }
.facts > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--stroke); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.notes { margin: 8px 0 12px; padding: 12px 12px 12px 30px; border-radius: 12px; background: var(--warn-soft); color: var(--text); font-size: 14px; }

.wallets { display: grid; gap: 8px; }
.wallet-btn { display: flex; align-items: center; gap: 10px; background: var(--bg); color: var(--text); border-color: var(--stroke); border-radius: 12px; text-align: left; }
.wallet-btn img { border-radius: 6px; }

.tokens { display: grid; gap: 8px; }
.token {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.token input { margin-top: 4px; width: 18px; height: 18px; }
.token-main { display: grid; min-width: 0; }
.token-symbol { font-weight: 700; overflow-wrap: anywhere; }
.token-source { font-size: 12px; color: var(--muted); }
.token-untrusted .token-source { color: var(--warn); }
.token-addr { font-size: 11px; }
.token-amount { display: grid; text-align: right; font-variant-numeric: tabular-nums; }
.token-receive { font-size: 12px; color: var(--muted); }

.more { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.more form { margin-top: 12px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.actions button { flex: 1; }

.faq { margin: 24px 0; }
.faq h2 { margin-bottom: 8px; }
details { background: var(--card); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }

.foot { padding-bottom: 32px; font-size: 13px; color: var(--muted); }

@media (max-width: 480px) {
  h1 { font-size: 24px; }
  .card { padding: 16px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .row { flex-direction: column; }
  .row button { width: 100%; }
}
