:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
main, .shell { max-width: 720px; margin: 28px auto; padding: 0 20px; }
.shell main { margin: 0; padding: 0; }
header { margin-bottom: 24px; }
.topbar, .header-title, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-title { justify-content: flex-start; }
.header-title a { text-decoration: none; font-size: 20px; }
h1 { font-size: 22px; font-weight: 600; margin: 0; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 14px; font-weight: 500; }
p { margin: 7px 0; }
a, a:visited { color: inherit; text-decoration: underline; }
section { margin: 24px 0; }
.pool-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.pool-totals p { margin: 2px 0; }
.estimate-stat { grid-column: 1 / -1; border-top: 1px solid #ddd; padding-top: 14px; }
.total-number { font-size: 28px; line-height: 1.25; font-weight: 500; font-variant-numeric: tabular-nums; }
.contribution-number { color: #087b35; font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.estimate-number { font-size: 21px; line-height: 1.25; font-weight: 500; margin: 4px 0; }
.estimate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.estimate-grid p { margin: 3px 0; }
.earnings-panel { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; padding: 16px 0; }
.projection-line { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; margin-top: 12px; }
.projection-line strong { font-weight: 500; }
.projection-line small { white-space: nowrap; }
.weight-progress-list { list-style: none; margin: 0; padding: 0; }
.weight-progress-list li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; margin: 12px 0; }
.weight-progress-list strong { font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.weight-progress-list progress { grid-column: 1 / -1; grid-row: 2; display: block; width: 100%; height: 5px; margin: 7px 0 0; accent-color: #111; }
.weight-progress-list progress::-webkit-progress-bar { background: #eee; }
.weight-progress-list progress::-webkit-progress-value { background: #111; }
.weight-progress-list progress::-moz-progress-bar { background: #111; }
.weight-progress-list .weight-progress-detail { grid-row: 1; grid-column: 2; margin: 0; text-align: right; max-width: 290px; }
.section-heading h2, .section-heading p { margin: 0; }
.section-heading { margin-bottom: 10px; }
.shared-prompt { white-space: pre-wrap; overflow-wrap: anywhere; color: #555; font-size: 13px; margin-top: 16px; }
nav, .controls, .actions, .form-actions, .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
form { display: grid; gap: 10px; }
label { display: block; }
input, textarea, select, button { font: inherit; color: #111; background: #fff; border: 1px solid #aaa; border-radius: 0; }
input, select, textarea { padding: 7px 9px; }
label input, label select { display: block; width: 100%; margin-top: 4px; }
textarea { display: block; width: 100%; min-height: 68px; resize: vertical; line-height: 1.5; }
input[type="number"] { width: 70px; }
input[type="range"] { display: block; width: 100%; margin: 8px 0 0; padding: 0; accent-color: #111; border: 0; }
.range-labels { display: flex; justify-content: space-between; width: 100%; font-size: 12px; color: #555; }
button { padding: 6px 12px; cursor: pointer; }
.icon-button { min-width: 36px; height: 32px; padding: 2px 8px; font-size: 20px; line-height: 1; }
#stopButton { font-size: 12px; }
button:disabled { color: #aaa; border-color: #ddd; cursor: default; }
button:hover:not(:disabled) { background: #f4f4f4; }
:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
::selection { background: #ddd; color: #111; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.note, .muted, small { font-size: 12px; color: #666; }
.chat-actions { display: flex; align-items: center; gap: 12px; }
.chat-actions > p { flex: 1; margin: 0; }
.chat-options { position: relative; margin: 0; }
.chat-options summary { list-style: none; font-size: 22px; line-height: 1; }
.chat-options summary::-webkit-details-marker { display: none; }
.chat-options label { position: absolute; right: 0; z-index: 1; padding: 10px; background: #fff; border: 1px solid #aaa; }
.client-list { display: grid; gap: 14px; }
.client-card { border-top: 1px solid #ddd; padding-top: 12px; }
.client-card-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.client-card-name { font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.client-card-meta { margin: 2px 0 8px; }
.client-card-main { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.client-share p { margin: 0 0 4px; }
.client-share .share-status { font-size: 12px; }
.client-share .share-status:empty { display: none; }
.client-card .icon-button { font-size: 12px; }
.client-estimate p { margin: 2px 0; }
.client-estimate .projection-line { margin-top: 6px; gap: 6px 12px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
dt, dd { margin: 0; }
dt { color: #666; }
details { margin: 16px 0; }
summary { cursor: pointer; }
details > :not(summary) { margin-top: 12px; }
.table-wrap, .table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #ddd; vertical-align: top; }
th { font-weight: 500; }
.response, #response { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; }
.share-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #ddd; padding-top: 16px; }
#phone-qr, #shareQr { display: block; width: 140px; height: 140px; }
#phone-link-row, #shareLinkRow { overflow-wrap: anywhere; }
.status, #status, #notice, #error { white-space: pre-wrap; overflow-wrap: anywhere; }
#error:empty { display: none; }
pre { font: 12px/1.5 ui-monospace, SFMono-Regular, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
@media (max-width: 500px) {
  main, .shell { margin: 20px auto; padding: 0 16px; }
  h1 { font-size: 20px; }
  .total-number { font-size: 26px; }
  .estimate-number { font-size: 18px; }
  dl { grid-template-columns: auto 1fr; gap: 4px 12px; }
  .client-card-main { gap: 12px; }
  .client-estimate .projection-line { flex-direction: column; gap: 1px; }
  .weight-progress-list .weight-progress-detail { max-width: 190px; }
}
