:root {
  color-scheme: light;
  --ink: #27243e;
  --muted: #625e74;
  --accent: #60439d;
  --line: #ddd9e7;
  --wash: #efecf7;
  --paper: #fbfafd;
  font: 16px/1.5 "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, input, select { min-height: 44px; border-radius: 9px; }
button { padding: 8px 14px; border: 1px solid transparent; font-weight: 650; }
input, select { width: 100%; min-width: 0; max-width: 100%; padding: 9px 11px; border: 1px solid #aca6bc; background: white; color: var(--ink); }
input::placeholder { color: #706d7e; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #845ec5; outline-offset: 3px; }
button:disabled, select:disabled { cursor: wait; opacity: .55; }
button.primary { background: var(--accent); color: white; }
button.primary:hover:enabled { background: #4b307f; }
button.quiet, .row-actions button { color: var(--ink); border-color: #c4bed2; background: white; }
button.quiet:hover:enabled, .row-actions button:hover:enabled { background: var(--wash); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(32px, 5.3vw, 56px); line-height: 1.04; letter-spacing: -.055em; font-weight: 680; }
h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; letter-spacing: -.035em; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.02em; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 650; }
input, select { font-size: 16px; font-weight: 500; }
.mast { color: white; background: var(--ink); padding-top: env(safe-area-inset-top); }
.mast-inner, main { width: min(100%, 1120px); margin: auto; padding-inline: max(clamp(17px, 4.7vw, 62px), env(safe-area-inset-left)) max(clamp(17px, 4.7vw, 62px), env(safe-area-inset-right)); }
.mast-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-name { font-size: 29px; font-weight: 700; letter-spacing: -.065em; line-height: 1; }
.brand-area { color: #ece6f6; border-left: 1px solid #6c637e; padding-left: 14px; font-size: 14px; }
.mast a, .mast button { color: white; background: transparent; text-decoration: underline; text-underline-offset: 4px; padding: 10px 2px; font-size: 14px; }
.mast a:focus-visible, .mast button:focus-visible { outline-color: #e1c9ff; }
main { padding-top: clamp(28px, 5vw, 58px); padding-bottom: max(48px, env(safe-area-inset-bottom)); }
.heading, .report-head, .placements-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.heading { margin-bottom: clamp(24px, 4vw, 42px); }
.heading .primary span { font-size: 18px; line-height: 1; }
.report { padding: clamp(16px, 3vw, 28px); border-radius: 14px; background: var(--wash); }
.range-label select { width: auto; background-color: var(--paper); }
.range-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 16px; }
.range-form label { min-width: 0; }
.period-caption, .report-note, .muted, .lead, .channel, .payment-date { color: var(--muted); }
.period-caption:empty { display: none; }
.period-caption { font-size: 14px; margin-top: 6px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0 12px; }
.summary > div + div { border-left: 1px solid #d4ccdf; padding-left: 18px; }
.summary dt { color: #514a63; font-size: 14px; }
.summary dd { font-size: clamp(23px, 3.8vw, 38px); font-weight: 680; letter-spacing: -.045em; line-height: 1.22; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.money-line { display: block; }
.report-note { font-size: 13px; max-width: 78ch; }
.notice, .error { padding: 12px 14px; border-left: 3px solid #a48d61; background: #fff5dd; color: #674d1a; margin-top: 14px; overflow-wrap: anywhere; }
.problem, .error { color: #813446; background: #fbeef0; border-color: #af5a6c; }
.text-button { color: inherit; padding: 0 3px; background: transparent; text-decoration: underline; }
.placements { margin-top: clamp(28px, 4vw, 44px); }
.placements-heading { justify-content: start; gap: 9px; padding-bottom: 13px; border-bottom: 2px solid #716781; }
#placements-count { color: var(--muted); font-size: 17px; font-variant-numeric: tabular-nums; }
.empty { max-width: 53ch; padding: 20px 0; color: var(--muted); }
.placement { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(180px, 1fr) auto; gap: 12px 20px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.placement h3, .channel { overflow-wrap: anywhere; }
.channel, .payment-date, .row-stats dt { font-size: 13px; }
.row-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-stats dt { color: var(--muted); }
.payment-date { font-weight: 500; }
.row-stats dd { font-weight: 650; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { font-size: 14px; padding-inline: 11px; }
.row-actions .copy-link { color: #513387; background: #f0ebf8; border-color: #d2c7e4; }
.login { max-width: 420px; margin: clamp(18px, 7vh, 80px) auto; }
.lead { margin: 8px 0 25px; }
#login-form, .editor-form { display: grid; gap: 16px; }
.startup { display: flex; align-items: center; justify-content: start; flex-wrap: wrap; gap: 12px; }
dialog { width: min(440px, calc(100% - 28px)); padding: clamp(18px, 4vw, 28px); max-height: calc(100dvh - 28px); color: var(--ink); background: white; border: 0; border-radius: 15px; overflow-y: auto; }
dialog::backdrop { background: rgb(31 23 46 / .54); }
.dialog-heading { gap: 8px; flex-wrap: nowrap; }
.close { flex: none; width: 44px; font-size: 26px; line-height: 1; background: transparent; color: var(--muted); }
.close:hover { background: var(--wash); }
.amount-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
#copy-dialog label { margin-top: 15px; }
.error { margin-top: 0; }
.toast:not(:empty) { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 10px 18px; border-radius: 10px; text-align: center; background: var(--ink); color: white; z-index: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 860px) {
  .placement { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .row-actions { grid-column: 1 / -1; }
}
@media (max-width: 590px) {
  .mast-inner { min-height: 52px; }
  .heading { align-items: stretch; flex-direction: column; }
  .report-head { align-items: start; gap: 10px; }
  .range-label { width: 100%; }
  .range-label select { width: 100%; }
  .range-form { display: grid; grid-template-columns: 1fr 1fr; }
  .range-form button { grid-column: 1 / -1; }
  .summary { display: block; margin: 12px 0; }
  .summary > div, .summary > div + div { border: 0; border-bottom: 1px solid #d8d1e3; padding: 8px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .summary dd { margin: 0; text-align: right; }
  .placement { grid-template-columns: minmax(0, 1fr); }
  .row-stats { width: 100%; }
  .row-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .row-actions button { padding-inline: 4px; }
}
