/* AgentWill — dark, calm, testament-like. Mobile-first. */
:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --card: #171d26;
  --card-border: #262e3a;
  --text: #e8e6df;
  --muted: #9aa3ad;
  --gold: #c9a227;
  --gold-soft: #e3c766;
  --green: #4caf7d;
  --red: #d96a5f;
  --amber: #d9a441;
  --blue: #6ea8d8;
  --btn: #c9a227;
  --btn-text: #16130a;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: .2px; }
h1 { margin: 0; font-size: 1.6rem; }
h2 { margin: 0 0 .6rem; font-size: 1.25rem; }
p { margin: .4rem 0; }
a { color: var(--gold-soft); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .85em; word-break: break-all; }
.hidden { display: none !important; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--card-border); background: var(--bg-soft); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 2rem; line-height: 1; color: var(--gold); }
.tagline { margin: 0; color: var(--muted); font-size: .9rem; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.network-badge {
  font-size: .8rem; padding: 5px 10px; border: 1px solid var(--card-border);
  border-radius: 999px; color: var(--muted); background: var(--card);
}
.network-badge.live { color: var(--green); border-color: var(--green); }
.network-badge.wrong { color: var(--red); border-color: var(--red); }

/* Cards */
main { padding: 20px 0 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.fine-print { font-size: .9rem; }
.fine-print ul { padding-left: 1.2rem; margin: .4rem 0; }
.fine-print li { margin: .3rem 0; }

/* Buttons */
.btn {
  font: inherit; font-size: .95rem; font-weight: 600;
  padding: 10px 18px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; background: var(--btn); color: var(--btn-text);
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--gold-soft); border-color: var(--card-border); }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }

/* Status card */
.agent-id-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; padding: 12px; border-radius: 9px; background: var(--bg-soft); border: 1px solid var(--card-border); }
.agent-id-box.ok { border-color: var(--green); }
.agent-id-box.no { border-color: var(--red); }
.agent-id-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; background: var(--card-border); color: var(--text);
}
.agent-id-box.ok .agent-id-icon { background: var(--green); color: #08130c; }
.agent-id-box.no .agent-id-icon { background: var(--red); color: #1d0b09; }
.agent-id-line { margin: 0; font-weight: 600; }
.claim-help { margin-top: 10px; padding: 12px; border-radius: 9px; background: #2a1f16; border: 1px solid var(--amber); }

/* Steps */
.steps { padding-left: 1.3rem; margin: .4rem 0; }
.steps li { margin: .45rem 0; }

/* Forms */
.field { display: block; margin: 12px 0; }
.field > span:first-child { display: block; font-weight: 600; margin-bottom: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req { color: var(--red); }
input[type="text"], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--card-border);
  border-radius: 8px; padding: 10px 12px;
}
input[type="text"]:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
textarea { resize: vertical; min-height: 90px; }
.hint { display: block; font-size: .83rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
.privacy-warning {
  margin: 12px 0; padding: 12px; border-radius: 9px;
  background: #2a1f16; border: 1px solid var(--amber); font-size: .92rem;
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-msg { min-height: 1.3em; margin-top: 10px; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: var(--green); }

/* Will list */
.will-list { display: grid; gap: 12px; }
.will {
  border: 1px solid var(--card-border); border-radius: 10px;
  padding: 14px; background: var(--bg-soft);
}
.will-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.will-title { font-weight: 700; }
.will-meta { font-size: .88rem; color: var(--muted); margin: .35rem 0; }
.will-meta .mono { font-size: .8rem; }
.will-msg { font-size: .95rem; margin: .5rem 0; white-space: pre-wrap; word-break: break-word; }
.will-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.badge {
  font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--card-border); color: var(--muted); white-space: nowrap;
}
.badge.healthy { color: var(--green); border-color: var(--green); }
.badge.due { color: var(--amber); border-color: var(--amber); }
.badge.overdue { color: var(--red); border-color: var(--red); }
.badge.released { color: var(--blue); border-color: var(--blue); }
.badge.cancelled { color: var(--muted); }
.countdown { font-size: .85rem; color: var(--muted); }

/* Leaderboard */
.leaderboard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.leaderboard table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.leaderboard th, .leaderboard td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.leaderboard th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.leaderboard tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .leaderboard table, .leaderboard tbody, .leaderboard tr, .leaderboard td { display: block; width: 100%; }
  .leaderboard thead { display: none; }
  .leaderboard tr { border-bottom: 1px solid var(--card-border); padding: 6px 0; }
  .leaderboard td { border-bottom: 0; padding: 2px 0; }
  .leaderboard td::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  .field-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
}

/* Footer + toast */
.site-footer { border-top: 1px solid var(--card-border); padding: 18px 0 28px; color: var(--muted); font-size: .88rem; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--gold); color: #16130a; font-weight: 600;
  padding: 10px 18px; border-radius: 9px; box-shadow: 0 4px 18px rgba(0,0,0,.5);
  max-width: calc(100vw - 32px); text-align: center; z-index: 50;
}
.toast.error { background: var(--red); color: #fff; }
