/* Layout: a district list, then one plan page: notes, service checklist, and quote history on the left, live quote on the right.
   Colors and type follow the Central Rivers AEA Visual Standards Guide: Navy 2757 C, Green 375 C, Orange 1375 C, Slate 5405 C, Cool Grays.
   Green and Orange are accents only; text colors meet WCAG AA contrast. */
:root {
  --navy: #001e5f;
  --green: #94d500;
  --green-dk: #638f38;
  --orange: #fa9e0d;
  --slate: #45637a;
  --gray11: #666366;
  --gray1: #e2e1dd;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --sunk: #E2E1DD;
  --fg: #1F2433;
  --head: #001e5f;
  --muted: #5C595C;
  --line: #D3D2CE;
  --accent: #001e5f;
  --accent-fg: #FFFFFF;
  --accent-soft: #E6EAF2;
  --warm: #fa9e0d;
  --warm-soft: #FFF1DB;
  --good: #3F6B1F;
  --good-soft: #EEF8DA;
  --warn: #7A4A00;
  --warn-soft: #FFF1DB;
  --bad: #9E2A1E;
  --bad-soft: #FBE6E3;
  --display: "Abadi MT Condensed", "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Barlow", "Arial Narrow", Arial, sans-serif;
  --r: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06122E;
    --surface: #0E1F45;
    --sunk: #16295A;
    --fg: #EEF0F4;
    --head: #FFFFFF;
    --muted: #B9BCC2;
    --line: #2A3C6A;
    --accent: #94d500;
    --accent-fg: #001e5f;
    --accent-soft: #1B3266;
    --warm-soft: #3A2A0C;
    --good: #A9E040;
    --good-soft: #1C3A12;
    --warn: #F6C35A;
    --warn-soft: #3A2A0C;
    --bad: #FF9C92;
    --bad-soft: #3A1A17;
    color-scheme: dark
  }
}

:root[data-theme="dark"] {
  --bg: #06122E;
  --surface: #0E1F45;
  --sunk: #16295A;
  --fg: #EEF0F4;
  --head: #FFFFFF;
  --muted: #B9BCC2;
  --line: #2A3C6A;
  --accent: #94d500;
  --accent-fg: #001e5f;
  --accent-soft: #1B3266;
  --warm-soft: #3A2A0C;
  --good: #A9E040;
  --good-soft: #1C3A12;
  --warn: #F6C35A;
  --warn-soft: #3A2A0C;
  --bad: #FF9C92;
  --bad-soft: #3A1A17;
  color-scheme: dark
}

* {
  box-sizing: border-box
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 var(--body);
  margin: 0
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--surface)
}

.skip {
  position: absolute;
  left: -9999px
}

.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 50;
  background: var(--surface);
  padding: 8px 12px;
  border: 2px solid var(--accent);
  border-radius: 6px
}

h1,
h2,
h3 {
  font-family: var(--display);
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--head);
  font-weight: 700
}

h1 {
  font-size: 1.5rem
}

h2 {
  font-size: 1.75rem
}

h3 {
  font-size: 1.2rem
}

p {
  margin: 0
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px
}

.num {
  font-variant-numeric: tabular-nums
}

.muted {
  color: var(--muted)
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap
}

.bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 4px solid var(--green)
}

.bar-in {
  max-width: 1300px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap
}

.brand {
  margin-right: auto;
  min-width: 0
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600
}

.yearpick {
  display: flex;
  align-items: center;
  gap: 8px
}

.save {
  font-size: .85rem;
  color: var(--muted);
  min-width: 8.5em;
  text-align: right
}

main {
  max-width: 1300px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px
}

label {
  font-weight: 600;
  font-size: .92rem
}

.hint {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 400
}

input,
select,
textarea {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 44px;
  min-width: 0
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  line-height: 1.45
}

input[type=checkbox] {
  width: 22px;
  height: 22px;
  min-height: 0;
  accent-color: var(--accent);
  margin: 0;
  flex: none
}

.btn {
  font: 600 .95rem/1 var(--body);
  border-radius: 6px;
  padding: 11px 16px;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.btn.ghost {
  background: transparent;
  color: var(--accent)
}

.btn.quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--fg)
}

.btn.small {
  padding: 7px 12px;
  min-height: 36px;
  font-size: .88rem
}

.btn:hover {
  filter: brightness(1.07)
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed
}

.linkbtn {
  background: none;
  border: 0;
  color: var(--accent);
  font: 600 .95rem var(--body);
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
  text-decoration: underline
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-block: 10px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0
}

.notice {
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: .95rem
}

.ok {
  border: 1px solid var(--good);
  background: var(--good-soft);
  border-radius: var(--r);
  padding: 12px 14px
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--fg);
  white-space: nowrap
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted)
}

.chip.st-progress {
  background: var(--accent-soft)
}

.chip.st-progress::before {
  background: var(--accent)
}

.chip.st-signed {
  background: var(--good-soft);
  border-color: var(--good)
}

.chip.st-signed::before {
  background: var(--good)
}

.tag {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--fg);
  border: 1px solid var(--orange);
  white-space: nowrap
}

/* District list */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px
}

@media (max-width:700px) {
  .tiles {
    grid-template-columns: minmax(0, 1fr)
  }
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  min-width: 0
}

.tile .k {
  display: block;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700
}

.tile {
  border-top: 4px solid var(--green)
}

.tile .v {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--head);
  font-variant-numeric: tabular-nums
}

.tile .split {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: .88rem
}

.tile .split dt {
  color: var(--muted)
}

.tile .split dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg)
}

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface)
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle
}

thead th {
  background: var(--sunk);
  font-size: .76rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap
}

tbody tr:last-child td {
  border-bottom: 0
}

td.r,
th.r {
  text-align: right
}

.find {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 420px
}

/* Plan */
.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: .9rem;
  color: var(--muted)
}

.facts strong {
  color: var(--fg);
  font-variant-numeric: tabular-nums
}

.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start
}

@media (max-width:900px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr)
  }
}

.col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0
}

details.grp {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r)
}

details.grp>summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  min-height: 52px
}

details.grp>summary::-webkit-details-marker {
  display: none
}

details.grp>summary::before {
  content: "+";
  font-weight: 700;
  color: var(--accent);
  width: 1em
}

details.grp[open]>summary::before {
  content: "\2212"
}

details.grp>summary h3 {
  margin-right: auto
}

.gmeta {
  font-size: .88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums
}

.rvw {
  font-size: .85rem;
  font-weight: 700;
  color: var(--good);
  white-space: nowrap
}

.rvrow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  margin: 12px 16px 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line)
}

.rvrow .tmck {
  white-space: normal
}

.rvprog {
  margin: 0 0 8px
}

.ghint {
  padding: 0 16px 8px 44px;
  font-size: .86rem;
  color: var(--muted)
}

.items {
  border-top: 1px solid var(--line)
}

.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 6px 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line)
}

.item:last-child {
  border-bottom: 0
}

.item.on {
  background: var(--accent-soft);
  box-shadow: inset 4px 0 0 var(--green)
}

.item label.nm {
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px
}

.item .pt {
  font-size: .84rem;
  color: var(--muted);
  font-weight: 400
}

.item .qty {
  display: flex;
  align-items: center;
  gap: 6px
}

.item .qty input {
  width: 104px
}

.item .qty span {
  font-size: .84rem;
  color: var(--muted)
}

.item .amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 6.5em;
  text-align: right
}

@media (max-width:600px) {
  .item {
    grid-template-columns: auto minmax(0, 1fr) auto
  }

  .item .qty {
    grid-column: 2/-1;
    grid-row: 2
  }

  .item .amt {
    grid-column: 3;
    grid-row: 1
  }
}

.item.locked {
  opacity: .65
}

.summary {
  border-top: 4px solid var(--orange) !important;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 80px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 100px);
  overflow: auto
}

@media (max-width:900px) {
  .summary {
    position: static;
    max-height: none
  }
}

.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .93rem;
  font-variant-numeric: tabular-nums
}

.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border-top: 2px solid var(--fg);
  padding-top: 10px
}

.sum-total .v {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--head);
  font-variant-numeric: tabular-nums
}

.guide {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: .93rem
}

.appr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px
}

@media (max-width:600px) {
  .appr {
    grid-template-columns: minmax(0, 1fr)
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0
}

.field input {
  width: 100%
}

.affirm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500
}

.affirm input {
  margin-top: 2px
}

.paper {
  background: #FFFFFF;
  color: #1F2433;
  border: 1px solid #D3D2CE;
  border-radius: 4px;
  padding: 24px clamp(16px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color-scheme: light
}

.paper h2 {
  color: #001e5f;
  font-size: 1.25rem
}

.paper th {
  background: transparent;
  color: #1F2433;
  border-bottom: 2px solid #1F2433
}

.paper td {
  border-bottom: 1px solid #D3D2CE
}

.paper .sect td {
  font-weight: 700;
  color: #001e5f;
  padding-top: 14px
}

.paper .tot td {
  font-weight: 700;
  border-top: 2px solid #1F2433
}

details.svc-d {
  border-bottom: 1px solid var(--line)
}

details.svc-d:last-child {
  border-bottom: 0
}

details.svc-d>summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px 12px 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  min-height: 48px;
  position: relative
}

details.svc-d>summary::-webkit-details-marker {
  display: none
}

details.svc-d>summary::before {
  content: "+";
  position: absolute;
  left: 20px;
  font-weight: 700;
  color: var(--accent)
}

details.svc-d[open]>summary::before {
  content: "\2212"
}

details.svc-d[open]>summary {
  background: var(--accent-soft)
}

details.svc-d .nm {
  font-weight: 600
}

details.svc-d .pt {
  font-size: .86rem;
  color: var(--muted)
}

.svc-info {
  margin: 0;
  padding: 12px 16px 14px 44px;
  display: grid;
  gap: 10px
}

.svc-info dt {
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700
}

.svc-info dd {
  margin: 2px 0 0;
  max-width: 68ch
}

.sum-grp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line)
}

.sum-gh {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  font-size: .92rem;
  font-variant-numeric: tabular-nums
}

.sum-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 10px;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  padding-left: 10px
}

.sum-line .d {
  grid-column: 1;
  color: var(--muted);
  font-size: .8rem;
  white-space: pre-line
}

.chg li span {
  white-space: pre-line
}

.item details.xp {
  grid-column: 1/-1;
  margin-left: 34px
}

.item details.xp>summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: .88rem;
  padding: 4px 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none
}

.item details.xp>summary::-webkit-details-marker {
  display: none
}

.item details.xp>summary::before {
  content: "+";
  font-weight: 700
}

.item details.xp[open]>summary::before {
  content: "\2212"
}

.item details.xp .xs {
  color: var(--muted);
  font-weight: 400
}

.xp-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
  padding: 6px 0 4px
}

@media (max-width:600px) {
  .xp-in {
    grid-template-columns: minmax(0, 1fr)
  }

  .item details.xp {
    margin-left: 0
  }
}

.xp-in textarea {
  min-height: 64px
}

.xrow {
  grid-column: 1/-1;
  margin-left: 34px;
  border-left: 3px solid var(--green);
  padding: 8px 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.xrow-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center
}

.xrow-top strong {
  margin-right: auto;
  font-weight: 600
}

.xrow .linkbtn {
  min-height: 36px;
  padding: 4px 0
}

.item .addrow {
  grid-column: 1/-1;
  justify-self: start;
  margin-left: 34px
}

@media (max-width:600px) {

  .xrow,
  .item .addrow {
    margin-left: 0
  }
}

.subs {
  grid-column: 1/-1;
  margin-left: 34px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 6px
}

.sub {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) auto 64px;
  gap: 8px;
  align-items: end;
  padding: 8px 10px;
  border-left: 4px solid var(--green);
  background: var(--surface);
  border-radius: 4px
}

.sub label {
  font-size: .78rem;
  font-weight: 600
}

.sub input {
  width: 100%
}

.sub .tmck input {
  width: 22px
}

.stm {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  grid-column: 1/-1;
  order: 1
}

.stm select {
  min-height: 44px;
  width: auto
}

.tmck {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap
}

.tmck small {
  font-weight: 400;
  color: var(--muted, #5C595C)
}

.sub.tm {
  border-left-color: var(--warm)
}

.sdw {
  grid-column: 1/-1;
  order: 99
}

/* Non-billable Special Education Enhancements */
.nbsec {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px
}

.nbsec h4 {
  margin: 0;
  font-size: .95rem
}

.nbsec .hint {
  margin: 0
}

.nbsec .subs {
  margin-left: 0
}

.sub.nb {
  grid-template-columns: 120px 84px minmax(0, 1fr) minmax(0, 1fr) auto 64px;
  border-left-color: var(--slate)
}

.sub.nb .nbc {
  grid-column: 1/4
}

.sub.nb .nbn {
  grid-column: 4/-1
}

@media (max-width:1100px) {
  .sub.nb {
    grid-template-columns: 120px 84px minmax(0, 1fr)
  }

  .sub.nb .nbt,
  .sub.nb .nbc,
  .sub.nb .nbn {
    grid-column: 1/-1
  }

  .sub.nb .samt {
    text-align: left;
    padding: 0
  }
}

@media (max-width:600px) {
  .sub.nb {
    grid-template-columns: minmax(0, 1fr) 84px
  }

  .sub.nb .nbl {
    grid-column: 1/-1
  }
}

details.sdates>summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: .88rem;
  padding: 4px 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none
}

details.sdates>summary::-webkit-details-marker {
  display: none
}

details.sdates>summary::before {
  content: "+";
  font-weight: 700
}

details.sdates[open]>summary::before {
  content: "\2212"
}

details.sdates .xs {
  color: var(--muted);
  font-weight: 400
}

.dts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 4px 0 2px
}

.dts .field {
  flex: 0 1 170px;
  min-width: 150px
}

.dts .field.hd {
  flex-basis: 300px
}

.hdp {
  display: flex;
  gap: 6px
}

.hdp input {
  flex: 1 1 150px;
  min-width: 0
}

.hdp select {
  flex: 0 0 auto;
  width: auto
}

.samt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-bottom: 11px;
  min-width: 5.5em;
  text-align: right
}

.sub .linkbtn {
  min-height: 44px;
  padding: 0;
  color: var(--bad)
}

.subs .addrow {
  margin-left: 0
}

@media (max-width:1100px) {
  .sub {
    grid-template-columns: 84px minmax(0, 1fr)
  }

  .sub .sc,
  .sub .sn,
  .sub .stm {
    grid-column: 1/-1
  }

  .sub .stm {
    order: 0
  }

  .samt {
    text-align: left;
    padding: 0
  }
}

@media (max-width:600px) {
  .subs {
    margin-left: 0
  }
}

.gcom {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg)
}

.gcom textarea {
  min-height: 80px
}

.grecs {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px
}

.grecs h4 {
  margin: 0;
  font-size: .95rem
}

.recrow {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  border-left: 4px solid var(--orange);
  background: var(--warm-soft);
  border-radius: 4px
}

.recrow .rd {
  grid-column: 1/-1;
  grid-row: 2
}

.recrow label {
  font-size: .78rem;
  font-weight: 600
}

.recrow input,
.recrow textarea,
.recrow select {
  width: 100%
}

.grecs.top {
  border-top: 0
}

.recrow.hassub {
  grid-template-columns: minmax(190px, 1.1fr) minmax(0, 1fr) 84px minmax(0, 1fr) minmax(0, 1fr) auto
}

.recrow .rtm {
  grid-column: 1/-1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px
}

.recrow .rtm select {
  width: auto;
  min-width: 160px
}

.recrow .rtm input[type=checkbox] {
  width: 22px;
  flex: none
}

.recrow.hassub .rd {
  grid-row: 3
}

@media (max-width:900px) {

  .recrow,
  .recrow.hassub {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)
  }

  .recrow .rd,
  .recrow.hassub .rd,
  .recrow .rtm {
    grid-row: auto
  }
}

.recrow textarea {
  min-height: 64px
}

.recrow .linkbtn {
  min-height: 44px;
  padding: 0;
  color: var(--bad)
}

.grecs .addrow {
  justify-self: start;
  align-self: flex-start
}

@media (max-width:600px) {
  .recrow {
    grid-template-columns: minmax(0, 1fr)
  }

  .recrow .rd {
    grid-row: auto
  }
}

.est {
  background: var(--warm-soft);
  border: 1px solid var(--orange);
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .88rem
}

.since {
  background: var(--good-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .9rem
}

.chg {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.chg li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  font-size: .93rem
}

.chg .k {
  font-size: .72rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunk);
  white-space: nowrap
}

.chg .k.add {
  background: var(--good-soft);
  border-color: var(--green-dk)
}

.chg .k.rem {
  background: var(--bad-soft)
}

.chg .k.adj {
  background: var(--warm-soft);
  border-color: var(--orange)
}

.chg .a {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap
}

.net {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums
}

details.ver {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface)
}

details.ver>summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  min-height: 48px
}

details.ver>summary::-webkit-details-marker {
  display: none
}

details.ver>summary::before {
  content: "+";
  font-weight: 700;
  color: var(--accent)
}

details.ver[open]>summary::before {
  content: "\2212"
}

details.ver .vn {
  font-weight: 700;
  margin-right: auto
}

details.ver .vd {
  color: var(--muted);
  font-size: .88rem
}

details.ver .vt {
  font-weight: 700;
  font-variant-numeric: tabular-nums
}

details.ver .in {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.hist {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.lgs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.lg {
  border-left: 4px solid var(--green);
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 4px
}

.lg-h {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline
}

.lg-t {
  color: var(--muted);
  font-size: .88rem;
  margin-left: auto
}

.lg-i {
  margin: 6px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.lg-d {
  margin: 6px 0 0;
  font-size: .9rem;
  color: var(--muted)
}

.lg-f {
  align-items: flex-end;
  margin-bottom: 12px
}

.lg-f select {
  min-height: 44px
}

.empty {
  padding: 20px;
  text-align: center;
  color: var(--muted)
}

.rates input {
  width: 120px
}

/* Analytics: estimated revenue by category */
.an-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px
}

.an-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  position: relative
}

.an-row {
  display: grid;
  grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
  cursor: default
}

.an-row .lb {
  font-weight: 600;
  font-size: .95rem
}

.an-track {
  height: 22px;
  position: relative
}

.an-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  min-width: 2px
}

.an-row:hover .an-bar,
.an-row:focus-visible .an-bar {
  filter: brightness(1.15)
}

.an-row .amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 7.5em;
  text-align: right;
  color: var(--fg)
}

.an-tip {
  position: absolute;
  pointer-events: none;
  background: var(--fg);
  color: var(--bg);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .85rem;
  line-height: 1.4;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2)
}

.an-sub {
  font-size: .85rem;
  color: var(--muted)
}

details.an-d {
  border-top: 1px solid var(--line)
}

details.an-d>summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 700;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  list-style: none
}

details.an-d>summary::-webkit-details-marker {
  display: none
}

details.an-d>summary::before {
  content: "+";
  color: var(--accent);
  width: 1em
}

details.an-d[open]>summary::before {
  content: "\2212"
}

details.an-d>summary span:last-child {
  margin-left: auto;
  font-variant-numeric: tabular-nums
}

details.an-d table {
  margin: 0 0 8px
}

@media (max-width:600px) {
  .an-row {
    grid-template-columns: minmax(0, 1fr) auto
  }

  .an-row .an-track {
    grid-column: 1/-1;
    grid-row: 2
  }
}

tr.grouprow th {
  background: var(--sunk);
  color: var(--head);
  font: 700 1rem/1.2 var(--display);
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  padding: 12px 10px 10px;
  border-top: 2px solid var(--accent)
}

/* "Prototype" watermark over the whole builder; clicks pass through it */
.wm {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden
}

.wm span {
  font: 700 clamp(48px, 12vw, 170px)/1 var(--display, 'Barlow Condensed', sans-serif);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: .07;
  transform: rotate(-30deg);
  white-space: nowrap;
  user-select: none
}

/* Someone else is on this plan: banner and confirm box */
.copresent {
  margin: 0
}

dialog.co {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  padding: 20px;
  max-width: min(460px, calc(100vw - 32px));
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25)
}

dialog.co::backdrop {
  background: rgba(0, 16, 48, .45)
}

dialog.co h2 {
  margin: 0 0 8px;
  font-size: 1.25rem
}

dialog.co p {
  margin: 0 0 10px
}

dialog.co ul {
  margin: 0 0 12px;
  padding-left: 20px
}

dialog.co .row {
  gap: 10px;
  margin-top: 6px
}

/* "Changing the tool" sign */
.lockbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  border-radius: var(--r);
  padding: 8px 14px;
  margin: 0 0 14px;
  font-size: .95rem
}

.lockbar.busy {
  border-color: var(--warn);
  background: var(--warn-soft)
}

.lockbar p {
  margin: 0;
  flex: 1 1 260px
}

.lockbar .btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}