@font-face {
  font-family: Inter;
  src: url('/assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #272a28;
  --muted: #696d65;
  --border: #e4e5df;
  --olive: #595e3e;
  --page: #f6f6f2;
  --slate: #506373;
  --sidebar: 222px;
  color-scheme: light;
  font-family: Inter,"Segoe UI",sans-serif;
  color: var(--ink);
  background: var(--page);
  font-size: 13px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,textarea,select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,select {
  cursor: pointer;
}

button {
  border: 0;
}

a,button,input,textarea,select {
  outline-offset: 4px;
}

button:focus-visible,a:focus-visible {
  outline: 3px solid #91764c;
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1.4px;
}

h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.55px;
}

h3 {
  font-size: 13px;
  font-weight: 650;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

small {
  font-size: 11px;
  color: var(--muted);
}

.layout {
  min-height: 100vh;
}

aside {
  width: var(--sidebar);
  background: #fbfbf8;
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 0 15px;
}

.brand {
  height: 100px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}

.brand span {
  font-size: 19px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: 2px;
}

.brand span small {
  display: block;
  color: #716451;
  font-size: 9px;
  letter-spacing: 4px;
  margin-top: 5px;
  font-weight: 600;
}

.rail-label,.eyebrow,.hero-kicker,.code {
  text-transform: uppercase;
  letter-spacing: 1.65px;
  font-size: 9.5px;
  font-weight: 700;
}

.rail-label {
  color: #777b70;
  margin: 32px 13px 10px;
}

.brand+.rail-label {
  margin-top: 14px;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 13px;
  margin: 2px 0;
  color: #51554c;
  font-weight: 520;
  border-radius: 7px;
}

.navlink:hover {
  background: #efefe9;
}

.navlink.active {
  background: #e7eade;
  color: #454e30;
  font-weight: 650;
}

.navlink.active svg {
  stroke-width: 2;
}

.rail-foot {
  margin-top: auto;
  padding: 18px 0 21px;
}

.workspace-flag {
  margin: 0 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #616753;
}

.workspace-flag i,.hero-kicker i {
  width: 7px;
  height: 7px;
  background: #87956e;
  border-radius: 50%;
}

.account {
  border-top: 1px solid var(--border);
  padding: 16px 3px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 35px;
  height: 35px;
  background: #e8e3d7;
  color: #625744;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 650;
}

.account b,.account small {
  display: block;
}

.account small {
  margin-top: 3px;
}

.account .iconbtn {
  margin-left: auto;
}

.iconbtn {
  width: 32px;
  height: 32px;
  background: transparent;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.iconbtn:hover {
  background: #e9ebe4;
}

.main {
  margin-left: var(--sidebar);
}

header {
  height: 65px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  justify-content: space-between;
}

.crumb,.top-actions,.top-date,.searchbox,.small,.text-link,.actions,.btn,.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crumb {
  color: #898d83;
  font-size: 12px;
}

.crumb b {
  font-weight: 570;
  color: #41473e;
}

.top-actions {
  gap: 18px;
}

.top-sep {
  height: 18px;
  width: 1px;
  background: var(--border);
}

.top-date {
  font-size: 12px;
  color: #61665d;
  white-space: nowrap;
}

#global-search {
  height: 34px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #777c71;
}

#global-search input {
  border: none;
  background: transparent;
  width: 132px;
  font-size: 12px;
  padding: 0;
}

kbd {
  border: 1px solid var(--border);
  color: #8a8f82;
  border-radius: 4px;
  font-size: 11px;
  padding: 1px 5px;
}

.main main {
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px 32px 42px;
}

#menu,.scrim {
  display: none;
}

.hero {
  background: #1d251f url('/assets/hero.jpg') center 60%/cover no-repeat;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 13px;
  color: #fff;
  min-height: 202px;
  padding: 27px 31px;
  display: flex;
  align-items: center;
}

.hero:before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg,rgba(25,31,27,.95),rgba(26,35,30,.82) 27%,rgba(29,37,32,.27) 59%,rgba(20,23,20,.03));
  z-index: -1;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #e1dfcb;
  letter-spacing: 2px;
}

.hero-kicker i {
  background: #c2c5a6;
  width: 17px;
  height: 2px;
  border-radius: 0;
}

.hero h1 {
  margin: 12px 0 7px;
  font-size: clamp(30px,3vw,45px);
  letter-spacing: -1.8px;
  font-weight: 590;
}

.hero p {
  color: #e0e2da;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  gap: 7px;
  min-height: 35px;
  padding: 7px 13px;
  background: #fff;
  border: 1px solid #dcdfd5;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 580;
  white-space: nowrap;
}

.btn:hover {
  background: #f1f3ec;
}

.btn.primary {
  border-color: var(--olive);
  background: var(--olive);
  color: #fff;
}

.btn.primary:hover {
  background: #454a30;
}

.hero-btn {
  margin-top: 18px;
  background: #f5f2e7;
  border-color: #f5f2e7;
  color: #34372d;
}

.section-head,.panel-head,.page-title,.metric-top,.pager,.projects article,.quote-link,.form-actions,.timeline a,.export-actions,.summary-money div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin: 24px 0 13px;
}

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

.small {
  font-size: 11px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
}

.metric,.panel,.template-strip>a {
  background: white;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 2px 4px #27312103;
}

.metric {
  display: block;
  padding: 14px 17px 15px;
}

.metric:hover,.template-strip>a:hover {
  border-color: #b1b6a5;
}

.metric-top {
  font-weight: 550;
  color: #565c51;
  font-size: 12px;
}

.metric-icon,.svc,.client-icon {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.metric-icon.sand,.s-INT {
  background: #f4ece0;
  color: #876849;
}

.metric-icon.blue,.s-SNG {
  background: #eaf0f4;
  color: #536d84;
}

.metric-icon.amber,.s-MNT {
  background: #f8efdf;
  color: #977134;
}

.metric-icon.olive,.s-LND {
  background: #eaf0e5;
  color: #647752;
}

.s-MIX,.svc:not([class*="s-"]) {
  background: #efedf3;
  color: #736c85;
}

.metric-value {
  margin: 7px 0 3px;
  font-size: clamp(24px,2.25vw,35px);
  font-weight: 590;
  letter-spacing: -1.4px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.metric-value em {
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0;
  color: #5f6358;
  font-weight: 550;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(0,2.65fr) minmax(185px,1fr);
  gap: 16px;
  margin-top: 20px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  padding: 19px 19px 15px;
}

.panel-head p,.section-head p {
  font-size: 11.5px;
  margin-top: 4px;
}

.text-link {
  background: transparent;
  border: 0;
  color: #596347;
  font-size: 11.5px;
  font-weight: 630;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

thead {
  background: #f8f9f6;
}

th {
  font-size: 10px;
  font-weight: 560;
  letter-spacing: .12px;
  color: #666c61;
}

th,td {
  padding: 10px 12px;
  border-bottom: 1px solid #eceee8;
}

th:first-child,td:first-child {
  padding-left: 19px;
}

th:last-child,td:last-child {
  padding-right: 19px;
}

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

tbody tr:hover {
  background: #f9faf7;
}

.right {
  text-align: right;
}

.numeric {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.quote-link {
  justify-content: flex-start;
  gap: 10px;
}

.quote-link b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.quote-link small,td small {
  display: block;
  font-size: 10.5px;
  margin-top: 3px;
}

.badge {
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 530;
  white-space: nowrap;
}

.badge i,.legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.approved {
  background: #eaf1e4;
  color: #506944;
}

.pending {
  background: #f9f0dc;
  color: #92682a;
}

.rejected {
  background: #f6e9e6;
  color: #9c6055;
}

.draft {
  background: #eef1f5;
  color: #596979;
}

.breakdown .panel-head {
  padding-bottom: 5px;
}

.donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 15px;
  margin: 6px auto 14px;
  transform: rotate(-90deg);
}

.donut div {
  border-radius: 50%;
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: rotate(90deg);
}

.donut strong {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
}

.donut span {
  font-size: 10px;
  color: var(--muted);
}

.legend {
  margin: 0 20px 16px;
}

.legend a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  padding: 4px 1px;
}

.legend strong {
  margin-left: auto;
  font-weight: 600;
}

.template-strip,.template-grid,.client-grid {
  display: grid;
  gap: 14px;
}

.template-strip {
  grid-template-columns: repeat(4,minmax(0,1fr));
}

.template-strip>a {
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.template-strip>a>svg {
  margin-left: auto;
  color: #858b7f;
}

.template-strip b,.template-strip small {
  display: block;
}

.template-strip small,.code {
  color: #797e70;
  font-size: 9px;
  letter-spacing: 1.3px;
}

.template-strip b {
  font-size: 12px;
  margin-top: 4px;
}

.page-title {
  margin: 8px 0 24px;
}

.page-title .eyebrow {
  color: var(--olive);
  margin-bottom: 10px;
}

.page-title p {
  margin-top: 8px;
}

.page-title h1 {
  overflow-wrap: anywhere;
}

.filters,.pager {
  padding: 15px 18px;
  display: flex;
  gap: 10px;
}

.filters {
  align-items: center;
  flex-wrap: wrap;
}

.filters>.searchbox {
  flex: 1;
  min-width: 180px;
}

.filters .btn {
  min-height: 36px;
}

.searchbox {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  padding: 0 10px;
  color: var(--muted);
}

.searchbox input {
  border: 0;
  width: 100%;
  min-width: 0;
}

.pager {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.pager>div,.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty,.loading,.error {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
}

.empty p {
  margin: 8px 0;
}

.pad {
  padding: 22px;
}

.pad .section-head {
  margin: 0 0 15px;
}

.panel+.panel,.detail-grid>div>.panel+.panel,#editor .panel+.panel {
  margin-top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

label {
  display: block;
  min-width: 0;
}

label>span {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #545c4e;
}

input,select,textarea {
  padding: 9px 10px;
  border: 1px solid #d9ddd3;
  border-radius: 6px;
  min-width: 0;
  background: #fff;
}

label input:not([type=checkbox]),label select,label textarea {
  width: 100%;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.checkbox {
  margin-top: 10px;
  font-size: 12px;
}

.checkbox input {
  accent-color: var(--olive);
}

.form-actions {
  justify-content: flex-end;
  margin-top: 17px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(130px,2.6fr) minmax(65px,.85fr) minmax(55px,.75fr) minmax(65px,.85fr) minmax(90px,1fr) 30px;
  gap: 9px;
  align-items: end;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.totals-edit {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
}

.totals-edit>div {
  min-width: 175px;
}

.totals-edit #calc {
  min-width: 215px;
}

.totals-edit #calc>* {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0;
  font-size: 12px;
}

.totals-edit #calc>strong {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0,2.4fr) minmax(230px,1fr);
  gap: 16px;
}

.quote-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.quote-meta>* {
  display: grid;
  gap: 4px;
}

.quote-meta span,.quote-meta small {
  font-size: 12px;
  color: var(--muted);
}

.summary-money {
  max-width: 300px;
  margin: 16px 0 0 auto;
}

.summary-money div {
  padding: 5px 0;
  font-size: 12px;
}

.summary-money div:last-child {
  font-size: 16px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding: 10px 0;
}

.doc-section {
  margin-top: 16px;
}

.doc-section p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.export-actions {
  margin-top: 14px;
  align-items: stretch;
  flex-direction: column;
}

.timeline {
  margin-top: 15px;
}

.timeline a {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-left: 2px solid var(--border);
  margin-left: 4px;
}

.timeline a.current {
  border-left-color: var(--olive);
  background: #f4f5ef;
}

.timeline b {
  font-size: 12px;
}

.client-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
  padding: 18px;
}

.client-grid>a {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.client-icon {
  background: #ebeee3;
  color: #5e6a48;
  margin-bottom: 5px;
}

.client-grid>a>span:last-child {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--olive);
  margin-top: 8px;
}

.projects article {
  justify-content: flex-start;
  padding: 12px 0;
}

.projects article small {
  display: block;
  margin-top: 3px;
}

.projects article a {
  margin-left: auto;
}

.template-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.template-grid h3 {
  margin-top: 14px;
}

.template-grid p {
  font-size: 12px;
  margin: 5px 0 12px;
}

.template-grid .actions {
  margin-top: 18px;
}

.brand-upload {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
}

.brand-upload img {
  width: 74px;
  height: 66px;
  object-fit: contain;
}

.form-subtitle {
  margin: 22px 0 12px;
}

dialog {
  width: min(540px,94vw);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

dialog::backdrop {
  background: #1d241ec0;
}

dialog .section-head {
  margin: 0 0 18px;
}

dialog .form-grid {
  grid-template-columns: 1fr 1fr;
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%,15px);
  opacity: 0;
  pointer-events: none;
  background: #333d2f;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  transition: .18s;
  z-index: 15;
  text-align: center;
  max-width: 90vw;
}

#toast.on {
  opacity: 1;
  transform: translate(-50%,0);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login section {
  max-width: 420px;
  padding: 34px;
  text-align: center;
}

.login img {
  width: 110px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.login p {
  margin: 12px 0 18px;
}

.login form {
  display: grid;
  gap: 12px;
}

@media(min-width:1550px) {
  :root {
    --sidebar: 245px;
  }
  .main main {
    padding: 32px 40px;
  }
  .hero {
    min-height: 238px;
  }
  .quote-link b,table {
    font-size: 13px;
  }
  .metric {
    padding: 20px;
  }
  .donut {
    width: 148px;
    height: 148px;
  }
  .legend a {
    padding: 6px 1px;
  }
  td {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media(max-width:1200px) {
  :root {
    --sidebar: 195px;
  }
  .main main {
    padding: 22px;
  }
  .board-grid {
    grid-template-columns: minmax(0,2.6fr) minmax(171px,1fr);
  }
  .board-grid td,.board-grid th {
    padding-left: 8px;
    padding-right: 8px;
  }
  .board-grid .quote-link {
    gap: 6px;
  }
  .board-grid .svc {
    width: 26px;
    height: 28px;
  }
  .template-strip>a {
    padding: 12px 9px;
    gap: 7px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 12px;
  }
  .hero {
    min-height: 184px;
  }
  .brand {
    padding-left: 6px;
  }
  aside {
    padding: 0 10px;
  }
  .panel-head {
    padding: 16px 13px;
  }
  .board-grid {
    gap: 12px;
  }
}

@media(max-width:1000px) {
  :root {
    --sidebar: 172px;
  }
  .board-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .breakdown {
    display: grid;
    grid-template-columns: 1fr 100px 1.3fr;
    align-items: center;
    padding: 10px;
  }
  .breakdown .panel-head {
    align-self: center;
  }
  .donut {
    width: 88px;
    height: 88px;
    padding: 10px;
    margin: 0;
  }
  .donut strong {
    font-size: 22px;
  }
  .legend {
    margin: 0 12px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .metric-top {
    font-size: 11px;
  }
  .template-strip {
    grid-template-columns: 1fr 1fr;
  }
  .top-date,.top-sep {
    display: none;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid>div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .detail-grid>div>.panel+.panel {
    margin: 0;
  }
  .item-row {
    grid-template-columns: 1.7fr .8fr .6fr .7fr .8fr 26px;
  }
  .client-grid {
    grid-template-columns: 1fr 1fr;
  }
  .service-strip b {
    font-size: 11px;
  }
}

@media(max-width:760px) {
  :root {
    --sidebar: 216px;
  }
  .main {
    margin: 0;
  }
  .main main {
    padding: 16px;
  }
  .brand {
    height: 80px;
  }
  aside {
    transform: translateX(-100%);
    transition: transform .18s;
  }
  .open aside {
    transform: translateX(0);
  }
  .open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: #1b211d66;
    z-index: 4;
  }
  header {
    height: 54px;
    padding: 0 15px;
    gap: 8px;
    justify-content: flex-start;
  }
  #menu {
    display: inline-grid;
  }
  .top-actions {
    margin-left: auto;
  }
  #global-search input {
    width: 94px;
    font-size: 11px;
  }
  kbd {
    display: none;
  }
  .hero {
    padding: 22px;
    min-height: 188px;
    background-position: 58% center;
  }
  .hero:before {
    background: linear-gradient(90deg,#1b261fef,#1b261fba 48%,#17251a35);
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 12px;
    max-width: 240px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric-value {
    font-size: 27px;
  }
  .metric {
    padding: 13px;
  }
  .section-head {
    margin-top: 20px;
  }
  .board-grid {
    margin-top: 14px;
  }
  .page-title {
    flex-wrap: wrap;
  }
  .page-title h1 {
    font-size: 28px;
  }
  .panel-head {
    padding: 15px;
  }
  .client-grid,.template-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filters {
    padding: 12px;
  }
  .form-grid,.form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
  .pad {
    padding: 16px;
  }
  .item-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    background: #fafbf7;
    padding: 10px;
    margin-bottom: 8px;
  }
  .line-description {
    grid-column: span 2;
  }
  .remove {
    justify-self: end;
  }
  .detail-grid>div {
    display: block;
  }
  .detail-grid>div>.panel+.panel {
    margin-top: 12px;
  }
  .top-date {
    display: none;
  }
  .breakdown {
    grid-template-columns: 1fr 90px 1fr;
  }
  .hero-kicker {
    font-size: 9px;
  }
  .template-strip {
    gap: 9px;
  }
  .client-grid {
    padding: 12px;
  }
}

@media(max-width:480px) {
  .main main {
    padding: 12px;
  }
  .crumb {
    font-size: 11px;
  }
  .top-actions input {
    max-width: 80px;
  }
  .board-grid td:nth-child(2),.board-grid th:nth-child(2) {
    display: none;
  }
  .board-grid .svc {
    display: none;
  }
  .board-grid td:first-child,.board-grid th:first-child {
    padding-left: 12px;
  }
  .quote-link b {
    font-size: 10px;
  }
  .numeric {
    font-size: 11px;
  }
  .board-grid .badge {
    font-size: 9.5px;
  }
  .metrics {
    gap: 8px;
  }
  .metric-icon {
    width: 26px;
    height: 26px;
  }
  .metric-value {
    font-size: 25px;
  }
  .metric small {
    font-size: 10px;
  }
  .breakdown {
    grid-template-columns: 90px 1fr;
    gap: 3px 12px;
  }
  .breakdown .panel-head {
    grid-column: 1/-1;
    padding: 5px 8px 10px;
  }
  .breakdown .donut {
    margin: 0 10px 5px;
  }
  .breakdown .legend {
    margin: 0 8px;
  }
  .form-grid,.form-grid.two,.client-grid,.template-grid,dialog .form-grid {
    grid-template-columns: 1fr;
  }
  .totals-edit {
    flex-wrap: wrap;
  }
  .totals-edit>div,.totals-edit #calc {
    min-width: 0;
    flex: 1;
  }
  .template-strip b {
    font-size: 11px;
  }
  .panel-head h2,h2 {
    font-size: 16px;
  }
  .hero {
    border-radius: 10px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .page-title .actions {
    gap: 5px;
  }
  .actions .btn {
    padding: 7px 9px;
  }
  .quote-meta {
    gap: 8px;
  }
  .brand-upload {
    flex-wrap: wrap;
  }
}

.brand img.brand-lockup {
  width: min(162px,100%);
  height: 48px;
  object-fit: contain;
  object-position: left center;
  border-radius: 0;
  mix-blend-mode: multiply;
}

.board-grid>.panel+.panel,.template-grid>.panel+.panel {
  margin-top: 0;
}
.party-panel { overflow: visible; position: relative; z-index: 2; }
.party-picker { position: relative; min-width: 0; }
.picker-control { position: relative; }
.picker-control input { width: 100%; padding-right: 40px; }
.picker-control .iconbtn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.picker-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 3;
  max-height: 240px; overflow-y: auto; background: white; border: 1px solid var(--border);
  border-radius: 7px; box-shadow: 0 8px 24px #26311c20;
}
.picker-list [role=option], .picker-empty { padding: 9px 11px; }
.picker-list [role=option] { cursor: pointer; overflow-wrap: anywhere; }
.picker-list [role=option]:hover, .picker-list [aria-selected=true] { background: #eff1e9; }
.picker-list strong, .picker-list small { display: block; }
.picker-list small { margin-top: 2px; }
.picker-empty { color: var(--muted); font-size: 12px; }
.party-panel input[readonly] { background: #f6f7f3; }
.billing-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin:18px 0; }
.billing-metrics .metric-value { font-size:clamp(20px,2vw,30px); }
.billing-error { color:#934f3b; font-size:12px; }
#payment { padding:15px; margin:12px 0 18px; background:var(--page); border-radius:7px; }

.plan-row{display:grid;grid-template-columns:minmax(12rem,2fr) minmax(6rem,1fr) auto;align-items:end;gap:.8rem;margin:.8rem 0}
#plan>label{display:block;max-width:30rem;margin:1rem 0}
#plan .table-scroll{margin:1rem 0}
#issue[hidden]{display:none}
@media(max-width:680px){.plan-row{grid-template-columns:minmax(0,1fr) 7rem}.plan-row button{grid-column:1/-1;justify-self:start}}

.subcontract-entry{padding:1rem 0;border-top:1px solid #e1e3d9}
.subcontract-entry p,.subcontract-entry h3{margin:.2rem 0}
.subcontract-entry small,.cost-preview small{color:var(--muted,#666)}
.subcontract-entry details{margin:.6rem 0}
.subcontract-entry summary{cursor:pointer}
.cost-preview{padding:.8rem;background:#f6f6f0;border-radius:8px}
#subcontracts .quote-meta,.cost-preview .quote-meta{display:flex;flex-wrap:wrap;gap:1rem 2.5rem}
#subcontracts{scroll-margin:2rem}

.report-filters{display:grid;grid-template-columns:minmax(200px,1.4fr) repeat(2,minmax(150px,1fr)) auto;align-items:end;gap:14px}
.report-amount{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
#report-rows td small{display:block}
@media(max-width:1000px){.report-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.report-filters{grid-template-columns:minmax(0,1fr)}}
@media(max-height:760px){aside{overflow-y:auto}}

@media(max-width:650px){
  .report-table,.report-table tbody{display:block}
  .report-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .report-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;padding:14px 18px;border-top:1px solid var(--border)}
  .report-table tbody td{padding:0;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
  .report-table tbody td:first-child{grid-column:1/-1;font-weight:600}
  .report-table td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px}
  .report-cash .metric:last-child{grid-column:1/-1}
}

.price-filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin-bottom:18px}
.price-filters label:first-child{flex:1 1 180px}
.price-dialog{width:min(800px,calc(100% - 28px));max-height:85vh;overflow:auto}
.price-results td{vertical-align:middle}
.price-results td small,.rate-history small{display:block;color:var(--muted);margin-top:4px}
.rate-amount{font-variant-numeric:tabular-nums;white-space:nowrap}
.rate-history{padding:14px 0;border-bottom:1px solid var(--border)}
.rate-history p{margin:4px 0}
.line-price-source{display:flex;flex-wrap:wrap;align-items:center;gap:5px 12px;margin-top:5px;font-size:11px;color:var(--muted)}
.line-price-source button{font-size:11px}
.item-row input[readonly]{background:#f6f7f3}
@media(max-width:600px){.price-filters label,.price-filters button{flex:1 1 100%}.price-results th,.price-results td{padding:8px}}
.item-description-options{display:flex;gap:16px;align-items:center;margin-top:8px;flex-wrap:wrap}.item-description-options .checkbox{margin:0}.item-sub-text{white-space:pre-wrap;color:var(--muted);margin-top:6px}.item-main-text{white-space:pre-wrap}.item-main-text.is-bold{font-weight:700}.line-description [data-sub-field]{margin-top:10px}.line-description textarea{min-height:90px}
#local-login label{display:flex;flex-direction:column;gap:7px;text-align:left}#local-login{gap:16px}#local-login [role=alert]{margin:0}
