/*
 * nimiq.work app layout — built on the legacy @nimiq/style (nq-* classes) 1.4.1.
 * Custom layout is authored in PX on purpose: @nimiq/style sets html{font-size:8px}
 * (1rem = 8px), so custom rem values would render half-size. Every color/gradient
 * resolves to a canonical --nimiq-* token. Light Nimiq app theme: #F8F8F8 page,
 * white cards, navy text, gold for reward amounts, green for success only.
 */

:root {
  --ink: var(--nimiq-blue, #1f2348);
  --muted: rgba(31, 35, 72, 0.5);
  --faint: rgba(31, 35, 72, 0.3);
  --page: #f8f8f8;
  --surface: #ffffff;
  --inset: #fafafa;
  --line: rgba(31, 35, 72, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: "Mulish", "Muli", system-ui, sans-serif !important;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--page); /* solid — no glassmorphism (rule 10) */
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .hex {
  display: block;
}
.brand .wordmark {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.net-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.app-header .spacer {
  flex: 1;
}
#connect {
  white-space: nowrap;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- tabs (underline, not pills — rule 17) ---- */
.tabs {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1;
  appearance: none;
  background: none;
  border: none;
  padding: 14px 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s var(--nimiq-ease, ease);
}
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--nimiq-light-blue, #0582ca);
}

/* ---- panels ---- */
.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px 64px;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}

/* ---- board ---- */
.bounty {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.08);
  padding: 18px;
  margin: 0 0 14px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: box-shadow 0.15s var(--nimiq-ease, ease), transform 0.15s var(--nimiq-ease, ease);
}
.bounty:hover {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
.bounty-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.bounty h2,
.detail h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.bounty .desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bounty-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
}
.reward {
  font-family: "Fira Mono", monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--nimiq-gold, #e9b213);
}
.deadline {
  font-size: 13px;
  color: var(--muted);
}
.state {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.state.paid {
  color: var(--nimiq-green, #21bca5);
}
.state.refunded,
.state.cancelled {
  color: var(--faint);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ---- forms (Post + proof) ---- */
.post-card {
  max-width: none;
  margin: 0;
}
.escrow-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--inset);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.field {
  margin-bottom: 14px;
  flex: 1;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field-row {
  display: flex;
  gap: 12px;
}
.nq-input {
  width: 100%;
  font-size: 15px;
}
textarea.nq-input {
  min-height: 76px;
  resize: vertical;
}
.nq-button.block {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
}

/* ---- detail ---- */
.detail .back-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink); /* navy, not blue/underlined (rule 21) */
  cursor: pointer;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.detail p {
  color: var(--ink);
}
.detail .sub {
  color: var(--muted);
  font-size: 14px;
}
.detail .reward-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0;
}
.actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.actions h3 {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.row .addr {
  font-family: "Fira Mono", monospace;
  font-size: 13px;
  color: var(--muted);
}
.locked {
  padding: 14px 16px;
  background: var(--inset);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.locked .amt {
  font-family: "Fira Mono", monospace;
  font-weight: 700;
  color: var(--nimiq-gold, #e9b213);
}
.receipt {
  padding: 16px;
  background: #e6f8f4; /* solid very-light green success surface */
  border-radius: 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #198a78;
}
/* ---- payout "wow" receipt (issue #13) ---- */
.receipt-card {
  padding: 28px 20px;
  background: #e6f8f4; /* solid very-light green success surface */
  border-radius: 12px;
  text-align: center;
}
.receipt-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-image: var(--nimiq-green-bg);
  background-color: var(--nimiq-green, #21bca5);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
}
.wow-amount {
  font-family: "Fira Mono", monospace;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: #198a78;
}
.receipt-settle {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #198a78;
}
.receipt-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.proofform {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--inset);
  border-radius: 10px;
}

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 20px;
  background-image: var(--nimiq-blue-bg);
  background-color: var(--nimiq-blue, #1f2348);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 30px rgba(31, 35, 72, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--nimiq-ease, ease);
  z-index: 50;
}
.toast.show {
  opacity: 1;
}

a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
a:hover {
  color: var(--nimiq-light-blue, #0582ca);
}
