/* The shared look of the reference apps. Each app sets --brand, --accent, --ink, --paper and --font from brands.py. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.5;
       font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
.muted { color: color-mix(in srgb, var(--ink) 58%, transparent); }
.small { font-size: 13px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* The strip that says this is the reference sandbox */
.sandbox-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 7px 20px; background: #111827; color: #e5e7eb; font: 12.5px/1.4 system-ui, sans-serif; }
.sandbox-bar a { color: #fde68a; text-decoration: none; font-weight: 600; }
.sb-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: #374151; color: #f9fafb; font-size: 11.5px; }
.pill-via { background: #0f766e; }

/* Logos */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: calc(var(--s) * .55); }
.logo svg { flex: none; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .12)); }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font: 600 15px var(--font); padding: 11px 20px; border-radius: 12px;
  text-decoration: none; transition: transform .08s, box-shadow .15s; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 45%, transparent); }
.btn.accent { background: var(--accent); color: var(--ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
input, select, textarea { font: inherit; color: inherit; padding: 10px 12px; border-radius: 10px; width: 100%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 16%, transparent); background: #fff; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
label { display: block; }
label > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
label.inline { display: inline-flex; gap: 8px; align-items: center; margin-right: 14px; font-weight: 500; }
label.inline input { width: auto; }
.stack { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1.5px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 12px; padding: 10px 14px; }
legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.flash { padding: 12px 16px; border-radius: 12px; background: #ecfdf5; color: #065f46; font-weight: 600; }
.flash.bad { background: #fef2f2; color: #991b1b; }
.note { padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, #fff); font-size: 14px; }

/* Cards and surfaces */
.card { background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 30px rgb(0 0 0 / .05); }
.card h2 { font-size: 18px; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.chip.accent { background: color-mix(in srgb, var(--accent) 30%, #fff); color: var(--ink); }
.divider { height: 1px; background: color-mix(in srgb, var(--ink) 10%, transparent); margin: 16px 0; }

/* The forwarding address, by the rules: shown without its +code, unselectable, copied whole (offer and forward §3) */
.forward { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--brand) 7%, #fff);
  border: 1.5px dashed color-mix(in srgb, var(--brand) 40%, transparent); border-radius: 14px; padding: 12px 14px; }
.forward .addr { flex: 1; font: 600 15px "JetBrains Mono", monospace; color: var(--brand); cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow-wrap: anywhere; }

/* Plans drawn in your own design (quote-api, Rules for your own design) */
.plans { display: grid; gap: 12px; }
.plan { position: relative; border: 1.5px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 16px; padding: 16px; background: #fff; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.plan .badge { position: absolute; top: -10px; left: 14px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800;
  letter-spacing: .05em; padding: 3px 8px; border-radius: 99px; }
.plan .fee { font-size: 22px; font-weight: 800; }
.plan.chosen { background: color-mix(in srgb, var(--brand) 6%, #fff); }

/* Phone frame, for the apps that live on a phone */
.phone { width: 380px; max-width: 100%; margin: 0 auto; border-radius: 44px; padding: 14px; background: #0b0b0f;
  box-shadow: 0 30px 80px rgb(0 0 0 / .25); }
.phone .screen { border-radius: 32px; overflow: hidden; background: var(--paper); min-height: 720px; position: relative; }
.phone .status { display: flex; justify-content: space-between; padding: 10px 22px 4px; font: 600 12.5px system-ui; }
.push-banner { margin: 8px 10px; padding: 12px 14px; border-radius: 18px; background: rgb(255 255 255 / .92);
  box-shadow: 0 10px 30px rgb(0 0 0 / .15); backdrop-filter: blur(10px); display: flex; gap: 10px; font-size: 13.5px; }

/* The developer panel */
body.dev { background: #f3f4f6; }
.dev-head { max-width: 1240px; margin: 0 auto; padding: 26px 20px 8px; }
.dev-head .back { display: inline-block; margin-bottom: 14px; text-decoration: none; font-weight: 600; }
.dev-head h1 { margin-top: 12px; font-size: 26px; }
.dev-grid { max-width: 1240px; margin: 0 auto; padding: 12px 20px 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dev-grid .wide { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { font-weight: 600; font-size: 13px; }
.kv dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
pre.json { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 12px; overflow: auto; max-height: 340px; margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
pre.json.tall { max-height: 520px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
table.cases { width: 100%; border-collapse: collapse; font-size: 14px; }
table.cases th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; padding: 8px; }
table.cases td { padding: 10px 8px; border-top: 1px solid #e5e7eb; vertical-align: top; }
table.cases td.seen { max-width: 380px; overflow-wrap: anywhere; white-space: pre-wrap; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 99px; background: #e5e7eb; font-weight: 800; font-size: 12px; }
.dot.ok { background: #d1fae5; color: #047857; }
.dot.bad { background: #fee2e2; color: #b91c1c; }
details.call { border-top: 1px solid #e5e7eb; padding: 8px 0; }
details.call summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.verb { font: 700 11.5px "JetBrains Mono", monospace; background: #e0e7ff; color: #3730a3; padding: 2px 6px; border-radius: 6px; }
.status { font: 700 11.5px "JetBrains Mono", monospace; padding: 2px 6px; border-radius: 6px; background: #e5e7eb; }
.status.s2 { background: #d1fae5; color: #065f46; } .status.s4 { background: #fef3c7; color: #92400e; } .status.s5, .status.s0 { background: #fee2e2; color: #991b1b; }
.call-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.call-body h4 { margin: 8px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }

@media (max-width: 860px) {
  .dev-grid, .call-body, .grid2 { grid-template-columns: 1fr; }
  .phone { border-radius: 0; padding: 0; box-shadow: none; background: none; }
  .phone .screen { border-radius: 0; min-height: 100vh; }
}
