* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --orange: #e67e22; --orange-dark: #cf6d15; --ink: #1a1a1a; --slate: #2c3e50;
  --muted: #637072; --bg: #f6f4f0; --card: #fff; --green: #27ae60; --red: #c0392b;
  --gold: #d4a017; --silver: #8e9aa5; --bronze: #b0713a;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: #333; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
/* Form controls use the page font (browsers default buttons/inputs to Arial). */
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #b85c12; }
a:hover { color: var(--orange); }
:focus-visible { outline: 3px solid rgba(230,126,34,0.55); outline-offset: 2px; }
select {
  width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 1em; margin: 4px 0 12px; background: #fff;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }
.narrow { max-width: 640px; }

header.tb {
  background: var(--slate); color: #fff; padding: 14px 0;
}
header.tb .wrap { padding: 0 20px; display: flex; align-items: center; gap: 14px; }
header.tb a { color: #fff; text-decoration: none; }
header.tb .logo { font-size: 1.3em; font-weight: 700; display: flex; align-items: center; gap: 8px; }
header.tb .logo .bone { font-size: 1.2em; }
header.tb nav { margin-left: auto; display: flex; gap: 18px; font-size: 0.95em; align-items: center; }
header.tb nav a { border-bottom: 2px solid transparent; padding: 2px 0; }
header.tb nav a:hover { color: var(--orange); }
header.tb nav a[aria-current="page"] { border-bottom-color: var(--orange); }
header.tb nav a.nav-acct { border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 4px 12px; }
header.tb nav a.nav-acct:hover { border-color: var(--orange); }
header.tb nav a.nav-acct[aria-current="page"] { border-color: var(--orange); }

.card {
  background: var(--card); border-radius: 10px; padding: 28px 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 20px;
}
h1 { color: var(--ink); font-size: 1.8em; margin-bottom: 10px; }
h1 .accent { color: var(--orange); }
h2 { color: var(--slate); font-size: 1.3em; margin: 18px 0 10px; }
h3 { color: var(--slate); font-size: 1.05em; margin: 14px 0 8px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
p { margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 0.92em; }
.pitch {
  border-left: 4px solid var(--orange); background: #fef9f3;
  padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 14px 0;
}

.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  background: var(--orange); color: #fff; font-size: 1em; font-weight: 600;
  padding: 10px 22px; border-radius: 8px; transition: background 0.15s;
}
.btn:hover { background: var(--orange-dark); color: #fff; }
.btn.secondary { background: #ecf0f1; color: var(--slate); }
.btn.secondary:hover { background: #dfe4e6; color: var(--slate); }
.btn.danger:hover { background: #f5c6c0; color: var(--red); }
.btn:disabled { opacity: 0.65; cursor: default; }
input[type=radio], input[type=checkbox] { accent-color: var(--orange); width: 18px; height: 18px; vertical-align: -3px; }
ul + p, ol + p { margin-top: 12px; }
.btn.small { padding: 5px 12px; font-size: 0.85em; }
.btn.danger { background: #fadbd8; color: var(--red); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.btn-row:empty { display: none; }
.quick-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; font-weight: 600; font-size: 0.95em; }
.quick-links a { text-decoration: none; }
.quick-links a:hover { text-decoration: underline; }

input[type=text], input[type=email], input[type=number], input[type=url], input[type=search] {
  width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 1em; margin: 4px 0 12px;
}
label { font-weight: 600; color: var(--slate); font-size: 0.95em; }
.radio-opt {
  display: block; border: 2px solid #e0e0e0; border-radius: 8px; padding: 12px 16px;
  margin: 8px 0; cursor: pointer; font-weight: normal;
}
.radio-opt:has(input:checked) { border-color: var(--orange); background: #fef9f3; }
.radio-opt b { color: var(--slate); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 14px 0; }
.stat { background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 14px 16px; }
.stat .v { font-size: 1.5em; font-weight: 700; color: var(--ink); }
.stat .v.orange { color: var(--orange); }
.stat .v.green { color: var(--green); }
.stat .l { font-size: 0.82em; color: var(--muted); margin-top: 2px; }
.stat-grid.g3 { grid-template-columns: repeat(3, 1fr); }

table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.92em; }
th, td { border-bottom: 1px solid #eee; padding: 8px 10px; text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.03em; }
td.num, th.num { text-align: right; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8em; font-weight: 600; }
.pill.pending { background: #fdf2e3; color: var(--orange-dark); }
.pill.confirmed { background: #e8f8ef; color: var(--green); }
.pill.rescinded { background: #f5e9e8; color: var(--red); }
.pill.gold { background: #faf3dc; color: var(--gold); }
.pill.silver { background: #eef1f4; color: var(--silver); }
.pill.bronze { background: #f5ece4; color: var(--bronze); }

.bar { background: #eee; border-radius: 999px; height: 10px; overflow: hidden; margin: 6px 0; }
.bar > div { height: 100%; background: var(--orange); border-radius: 999px; }
.bar > div.green { background: var(--green); }

.banner { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-size: 0.95em; }
.banner.info { background: #eaf2fb; color: #2471a3; }
.banner.warn { background: #fdf2e3; color: var(--orange-dark); }
.banner.ok { background: #e8f8ef; color: var(--green); }

.demo-note {
  background: #2c3e50; color: #ecf0f1; font-size: 0.85em;
  padding: 8px 14px; border-radius: 6px; margin-bottom: 18px;
}
.demo-note b { color: var(--orange); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* Let grid children shrink below their content width so inner .tscroll tables
   can scroll instead of stretching the page (grid/flex default is min-width:auto). */
.split > * { min-width: 0; }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 120px; margin: 12px 0 4px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.trend .col .b { width: 70%; background: var(--orange); border-radius: 4px 4px 0 0; min-height: 2px; }
.trend .col .lbl { font-size: 0.7em; color: var(--muted); margin-top: 4px; white-space: nowrap; }

footer.tb { text-align: center; color: var(--muted); font-size: 0.85em; padding: 26px 16px 34px; line-height: 1.9; border-top: 1px solid #e8e4dc; margin-top: 10px; }
footer.tb .foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 6px; }
footer.tb a { color: #5d6d7e; text-decoration: none; }
footer.tb a:hover { color: var(--orange); text-decoration: underline; }
footer.tb .foot-brand { font-weight: 700; color: var(--slate); }

/* ---------- shared components ---------- */
.step-dots { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.82em; margin-bottom: 10px; }
.step-dots i { width: 22px; height: 5px; border-radius: 3px; background: #e6e2d8; display: inline-block; }
.step-dots i.on { background: var(--orange); }
.inline-form { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; margin: 0; }
.link-btn { background: none; border: none; color: #b85c12; cursor: pointer; padding: 0; text-decoration: underline; font-size: inherit; }
.link-btn:hover { color: var(--orange); }
.copy-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; margin: 8px 0 4px; }
.copy-row input { flex: 1 1 220px; margin: 0; background: #faf8f4; font-variant-numeric: tabular-nums; color: var(--slate); }
.onboard { border: 2px solid #f3d9b8; background: linear-gradient(180deg, #fffaf3, #fff); }
.onboard h2 { margin-top: 0; }
.todo { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.todo li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; }
.todo li .ic { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fef1e2; display: flex; align-items: center; justify-content: center; font-size: 1.05em; }
.todo li b { color: var(--slate); display: block; }
.todo li span.d { color: #666; font-size: 0.92em; }
.todo li .btn { margin-top: 8px; }

.snack { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 9200; max-width: 92vw;
  background: var(--slate); color: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex; gap: 16px; align-items: center; font-size: 0.95em; }
.snack[hidden] { display: none; }
.snack button { background: none; border: none; color: #f6b073; font-weight: 700; cursor: pointer; padding: 4px 2px; font-size: 1em; }

/* Tipper's tip list: one compact row per tip at every width. */
.tips { list-style: none; margin: 8px 0 0; padding: 0; }
.tip-row { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid #f0ece4; }
.tip-row:last-child { border-bottom: none; }
.tip-main { flex: 1; min-width: 0; }
.tip-main .who { font-weight: 600; color: var(--slate); }
.tip-main .what { font-size: 0.88em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-main .what a { color: #7b8a8b; }
.tip-side { text-align: right; flex: none; }
.tip-side .amt { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tip-side .pill { margin-top: 2px; }
.tip-del { flex: none; background: none; border: 1px solid #f1c6c0; color: var(--red); border-radius: 8px; padding: 6px 10px; font-size: 0.82em; font-weight: 600; cursor: pointer; }
.tip-del:hover { background: #fdecea; }
.tip-del-ph { flex: none; width: 66px; }

.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero-demo .demo-mock { margin-top: 8px; }
a.demo-mock { display: block; text-decoration: none; color: #3b3b3b; transition: box-shadow .15s, transform .15s; }
a.demo-mock:hover { color: #3b3b3b; box-shadow: 0 6px 18px rgba(0,0,0,0.08); transform: translateY(-1px); }
.try-link { text-align: center; margin: 10px 0 0; font-weight: 600; font-size: 0.95em; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; gap: 6px; } }

/* Hosted creator page (/a/:id). */
.hp { text-align: center; padding-top: 34px; }
.hp-avatar { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px; background: linear-gradient(135deg, #f0a35a, var(--orange-dark));
  color: #fff; font-weight: 800; font-size: 1.7em; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(207,109,21,0.3); }
.hp h1 { margin-bottom: 2px; }
.hp-by { color: var(--muted); margin-bottom: 14px; }
.hp-site { font-weight: 600; text-decoration: none; }
.hp-msg { max-width: 460px; margin: 0 auto 18px; }
.hp-bone { background: #fffaf3; border: 1px solid #f3dcc0; border-radius: 14px; padding: 18px 14px 14px; max-width: 420px; margin: 0 auto; }
.hp-ask { font-weight: 700; color: var(--slate); font-size: 1.1em; margin-bottom: 8px; }
.hp-hint { color: var(--muted); font-size: 0.82em; margin-top: 8px; }

/* For-creators page: the bone readers will see, plus a check-list. */
.creator-demo { text-align: center; background: #fffdf8; border: 1px dashed #e2d6bf; border-radius: 12px; padding: 18px 14px 14px; margin: 16px 0; }
.creator-demo .cd-text { font-family: Georgia, 'Times New Roman', serif; color: #5b4a33; margin-bottom: 8px; }
.creator-demo .cd-note { font-size: 0.82em; color: var(--muted); margin-top: 8px; }
ul.checks { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
ul.checks li { padding-left: 28px; position: relative; }
ul.checks li::before { content: '✓'; position: absolute; left: 4px; top: 0; color: var(--green); font-weight: 800; }

/* Bone-in-action illustration on the home page. */
.demo-mock { background: #fffdf8; border: 1px solid #ece4d4; border-radius: 12px; padding: 16px 18px 14px; margin: 18px 0 4px; position: relative; font-family: Georgia, 'Times New Roman', serif; color: #3b3b3b; }
.demo-mock .dm-site { font-weight: 700; font-size: 0.95em; color: #6b4a1c; }
.demo-mock .dm-line { height: 8px; border-radius: 4px; background: #ece6da; margin: 8px 0; }
.demo-mock .dm-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.92em; margin-top: 12px; }
.demo-mock .dm-pop { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #fff; border: 2px solid var(--orange); border-radius: 10px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); margin-top: 12px; max-width: 300px; }
.demo-mock .dm-pop b { font-size: 0.88em; color: var(--slate); }
.demo-mock .dm-amts { display: flex; gap: 6px; margin-top: 6px; }
.demo-mock .dm-amts span { flex: 1; text-align: center; border: 1px solid var(--orange); color: var(--orange); border-radius: 6px; padding: 5px 0; font-weight: 700; font-size: 0.85em; }
.demo-mock .dm-amts span.on { background: var(--orange); color: #fff; }
.demo-mock .dm-cap { position: absolute; top: -10px; right: 14px; background: var(--slate); color: #fff; font: 600 0.72em -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }

/* ---------- tipper wallet & payment method ---------- */
.funds { background: #fffaf3; border: 1px solid #f3dcc0; border-radius: 10px; padding: 16px; margin: 14px 0 4px; }
.funds-amts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.funds-amts .btn { min-width: 76px; }
.funds-custom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.funds-custom input { width: 150px; margin: 0; }
.pm-card { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fafafa; border: 1px solid #eee;
  border-radius: 8px; padding: 12px 14px; font-variant-numeric: tabular-nums; }
.pm-brand { font-weight: 700; color: var(--slate); }
.pm-remove { margin-left: auto; color: var(--red); font-size: 0.9em; }
.pm-auto { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; margin-top: 14px; cursor: pointer; }
.pm-auto input { margin-top: 4px; }
.pm-auto.off { color: var(--muted); cursor: default; }

/* ---------- admin feedback inbox ---------- */
.fb-item { border: 1px solid #eee; border-left: 4px solid var(--orange); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.fb-item.done { border-left-color: #ccc; opacity: 0.6; }
.fb-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fb-head .btn { margin-left: auto; }
.fb-msg { white-space: pre-wrap; margin: 8px 0 6px; }
.fb-meta { font-size: 0.8em; color: var(--muted); word-break: break-all; }

/* ---------- widget designer (creator dashboard) ---------- */
.bd-preview {
  position: relative; background: #fff; border: 1px dashed #d5cebe; border-radius: 10px;
  padding: 30px 16px 24px; text-align: center; margin: 10px 0 16px; transition: background 0.2s;
}
.bd-preview.dark { background: #23272e; border-color: #4a4a4a; }
.bd-bubble {
  display: inline-block; background: #2c3e50; color: #fff; font-size: 12px;
  padding: 5px 10px; border-radius: 6px; margin-bottom: 10px; max-width: 100%;
}
.bd-preview.dark .bd-bubble { background: #e8e8e8; color: #23272e; }
.bd-bgtoggle { position: absolute; top: 8px; right: 8px; }
.bd-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; align-items: center; }
.bd-swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ccc; cursor: pointer; padding: 0;
}
.bd-swatch.sel { box-shadow: 0 0 0 3px var(--orange); }
.bd-classic { background: linear-gradient(135deg, #f3e3c3 50%, #c9a86a 50%); }
#bd-custom { width: 34px; height: 34px; border: none; padding: 0; background: none; cursor: pointer; }

/* Horizontal scroll wrapper for wide data tables (keeps the page from scrolling). */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }

/* ---------- Homepage explainer components ---------- */
.steps { display: grid; gap: 18px; margin: 16px 0 4px; }
.step-item { display: flex; gap: 14px; align-items: flex-start; }
.step-item .n {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 0.9em;
  display: flex; align-items: center; justify-content: center;
}
.step-item .t b { color: var(--slate); display: block; margin-bottom: 2px; }
.step-item .t span { color: #555; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.feature { background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 14px 16px; }
.feature b { color: var(--slate); display: block; margin-bottom: 3px; }
.feature span { font-size: 0.92em; color: #555; }

.faq details { border-bottom: 1px solid #eee; padding: 13px 2px; }
.faq details:last-child { border-bottom: none; padding-bottom: 0; }
.faq summary {
  cursor: pointer; font-weight: 600; color: var(--slate); list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--orange); font-weight: 700; flex: none; font-size: 1.1em; }
.faq details[open] summary::after { content: '\2013'; }
.faq details p { margin: 10px 0 2px; color: #555; font-size: 0.95em; }

.fund-card { border: 2px solid #eee; border-radius: 10px; padding: 18px 20px; height: 100%; }
.fund-card h3 { margin-top: 0; color: var(--slate); }
.fund-card .tagline { color: var(--orange-dark); font-weight: 600; font-size: 0.88em; margin-bottom: 6px; }
.fund-card ul { padding-left: 20px; margin-bottom: 0; font-size: 0.95em; color: #555; }

/* ---------- Mobile (phones) ---------- */
@media (max-width: 640px) {
  .wrap { padding: 16px 14px 48px; }
  .card { padding: 20px 18px; border-radius: 9px; }
  h1 { font-size: 1.5em; }
  h2 { font-size: 1.2em; }

  /* Header: logo on top, nav wraps onto its own full-width row. */
  header.tb .wrap { flex-wrap: wrap; row-gap: 10px; padding: 0 14px; }
  header.tb .logo { font-size: 1.15em; }
  header.tb nav { width: 100%; margin-left: 0; gap: 10px 18px; flex-wrap: wrap;
    font-size: 0.92em; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.12); }
  header.tb nav a { padding: 3px 0; }
  header.tb nav a.nav-acct { margin-left: auto; padding: 3px 12px; }

  .inline-form .btn { width: 100%; text-align: center; }
  .copy-row input { flex-basis: 100%; }
  .copy-row .btn { flex: 1 1 auto; text-align: center; white-space: nowrap; padding: 8px 10px; }
  .tip-row { gap: 10px; }
  .tip-del { padding: 6px 8px; }

  /* Two compact stat tiles per row instead of one giant column. */
  .stat-grid, .stat-grid.g3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bd-preview { padding-top: 50px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 1.3em; }
  .stat .l { font-size: 0.78em; }

  /* Full-width, thumb-friendly action buttons. */
  .btn-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .btn-row .btn { text-align: center; }
  .btn { padding: 11px 18px; }

  /* Wide (4-5 col) tables scroll sideways within their card rather than blowing
     out the page; narrow logs just wrap. */
  .tscroll.wide table { min-width: 480px; }

  /* Stacked layout: turn a data table into one labeled card per row so nothing
     is hidden off-screen (used for the tipper's "bones you've thrown"). */
  table.stacked, table.stacked tbody { display: block; }
  table.stacked tr { display: block; padding: 10px 0; border-bottom: 1px solid #eee; }
  table.stacked tr:first-child { display: none; } /* header row */
  table.stacked td { display: block; border: none; padding: 4px 2px; text-align: right; overflow: hidden; }
  table.stacked td::before { content: attr(data-label); float: left; margin-right: 12px;
    font-weight: 600; color: var(--muted); font-size: 0.72em; text-transform: uppercase;
    letter-spacing: 0.03em; padding-top: 2px; }
  table.stacked td.tb-action { text-align: center; padding-top: 10px; }
  table.stacked td.tb-action::before { content: none; }
  table.stacked td.tb-action .btn { width: 100%; }
  table.stacked td.tb-action:empty { display: none; }

  .split { gap: 14px; }
  .trend { height: 100px; }
  .trend .col .lbl { font-size: 0.58em; }
  .pitch { padding: 12px 14px; }
  .demo-note { font-size: 0.8em; }
}

/* Very small phones: single stat column so values never truncate. */
@media (max-width: 360px) {
  .stat-grid { grid-template-columns: 1fr; }
}
