:root {
  --red: #df1f2d;
  --red-dark: #94121c;
  --ink: #17191c;
  --muted: #626b73;
  --line: #d9dde1;
  --soft: #f5f3ee;
  --paper: #ffffff;
  --steel: #20242a;
  --green: #586b3d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  width: 100%;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.1;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 1.55rem;
}

label {
  display: grid;
  min-width: 0;
  gap: .4rem;
  color: #35404a;
  font-size: .9rem;
  font-weight: 800;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cdd3d8;
  border-radius: .5rem;
  padding: .78rem .85rem;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 .2rem rgba(223, 31, 45, .14);
}

.button {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  cursor: pointer;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.button-primary {
  color: #fff;
  background: var(--red);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-secondary {
  color: #fff;
  background: #505860;
}

.button-quiet {
  color: #e9edf1;
  background: transparent;
  border-color: rgba(255, 255, 255, .18);
}

.text-link {
  color: var(--red-dark);
  font-weight: 850;
  text-decoration: none;
}

.eyebrow {
  margin-bottom: .5rem;
  color: var(--red-dark);
  font-size: .75rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.flash {
  padding: .8rem .95rem;
  border-radius: .5rem;
  font-weight: 800;
}

.flash-success {
  color: #23421f;
  background: #dff1d8;
}

.flash-error {
  color: #7c111c;
  background: #ffdfe3;
}

/* Landing */
.landing-body {
  color: #fff;
  background: #111214;
}

.landing-page {
  min-height: 100vh;
  background: #111214;
}

.landing-hero {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 86vh;
  padding: 1.5rem;
}

.mulch-hero {
  background:
    linear-gradient(90deg, rgba(7, 8, 9, .9), rgba(7, 8, 9, .42) 45%, rgba(7, 8, 9, .12)),
    linear-gradient(0deg, rgba(17, 18, 20, .72), rgba(17, 18, 20, 0) 34%),
    url("images/landing-mulch-loading.jpg") center / cover;
}

.landing-nav,
.landing-brand,
.landing-nav-actions,
.hero-actions {
  display: flex;
  align-items: center;
}

.landing-nav {
  justify-content: space-between;
  gap: 1rem;
}

.landing-brand {
  gap: .75rem;
  color: #fff;
  text-decoration: none;
}

.landing-brand img {
  width: 4.6rem;
  height: 4.6rem;
  border-radius: .5rem;
  object-fit: cover;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .38);
}

.landing-brand strong,
.landing-brand small {
  display: block;
}

.landing-brand small {
  color: #c7ccd2;
}

.landing-nav-actions {
  gap: .8rem;
}

.landing-nav-actions a {
  color: #f2f4f6;
  font-weight: 850;
  text-decoration: none;
}

.landing-copy {
  width: min(52rem, 100%);
  padding-bottom: 4rem;
}

.landing-copy h1 {
  max-width: 48rem;
  font-size: 5.6rem;
}

.landing-copy p {
  max-width: 42rem;
  color: #e4e8eb;
  font-size: 1.25rem;
  line-height: 1.58;
}

.hero-actions {
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}

.landing-intro,
.landing-media,
.landing-split,
.landing-process,
.landing-cta {
  padding: 4rem;
}

.landing-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, .7fr);
  gap: 2rem;
  align-items: end;
  color: #151614;
  background: #f2f1ec;
}

.landing-intro p,
.landing-media p {
  color: #4f5750;
  font-size: 1.05rem;
  line-height: 1.65;
}

.landing-intro h2,
.landing-media h2,
.landing-split h2,
.landing-process h2,
.landing-cta h2 {
  max-width: 52rem;
  font-size: 3rem;
}

.landing-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #33383a;
}

.landing-band article {
  display: grid;
  align-content: start;
  gap: .8rem;
  min-height: 16rem;
  padding: 2rem;
  background: #181a1d;
}

.landing-band article > span {
  width: 2.4rem;
  height: .35rem;
  border-radius: 999px;
  background: #8f6a3e;
}

.landing-band p,
.landing-split p,
.landing-process p,
.landing-cta p {
  color: #c7ccd2;
  line-height: 1.6;
}

.landing-media {
  display: grid;
  gap: 1.5rem;
  color: #151614;
  background: #f7f5ee;
}

.landing-section-copy {
  max-width: 54rem;
}

.media-grid {
  display: grid;
  grid-template-columns: 1.25fr .85fr .85fr;
  gap: 1rem;
  align-items: stretch;
}

.media-grid figure {
  position: relative;
  min-height: 18rem;
  margin: 0;
  overflow: hidden;
  border-radius: .5rem;
  background: #1b1d1b;
  box-shadow: 0 1rem 2rem rgba(38, 32, 24, .16);
}

.media-grid figure:first-child {
  min-height: 30rem;
}

.media-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-grid figcaption {
  position: absolute;
  right: .85rem;
  bottom: .85rem;
  left: .85rem;
  padding: .5rem .65rem;
  border-radius: .45rem;
  color: #fff;
  font-size: .85rem;
  font-weight: 950;
  background: rgba(9, 10, 12, .74);
}

.landing-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, .75fr);
  gap: 2rem;
  background:
    linear-gradient(135deg, rgba(39, 48, 34, .76), rgba(17, 18, 20, .98)),
    #111214;
}

.proof-list {
  display: grid;
  gap: .75rem;
}

.proof-list p {
  margin: 0;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: .5rem;
  background: rgba(255, 255, 255, .055);
}

.landing-process {
  display: grid;
  gap: 1.5rem;
  background: #151715;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.process-grid article {
  display: grid;
  align-content: start;
  gap: .7rem;
  min-height: 14rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: .5rem;
  background: #20231f;
}

.process-grid span {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 950;
  background: var(--red-dark);
}

.landing-cta {
  display: grid;
  justify-items: start;
  gap: 1rem;
  background:
    linear-gradient(135deg, rgba(120, 74, 38, .24), rgba(20, 22, 25, .96)),
    #181a1d;
}

/* Auth and setup */
.auth-body {
  background:
    linear-gradient(90deg, rgba(7, 8, 9, .42), rgba(7, 8, 9, .78)),
    url("images/pijuy-trucks.jpg") center / cover fixed;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(20rem, 27rem);
  align-items: center;
  gap: 5rem;
  width: min(76rem, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 3rem 0;
  color: #fff;
}

.auth-copy {
  text-shadow: 0 .2rem 1.2rem #000;
}

.auth-copy h1 {
  font-size: 5rem;
}

.lead {
  max-width: 42rem;
  color: #d9dde1;
  font-size: 1.2rem;
  line-height: 1.6;
}

.login-logo {
  width: 8.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: .5rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .5);
}

.login-panel,
.setup-panel {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(185, 190, 197, .3);
  border-radius: .5rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, .36);
}

.login-panel h2,
.setup-panel h1 {
  color: var(--ink);
}

.setup-body {
  background: var(--soft);
}

.setup-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.setup-panel {
  width: min(42rem, 100%);
}

.setup-logo {
  width: 5rem;
  border-radius: .5rem;
}

.setup-panel pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border-radius: .5rem;
  color: #63202b;
  background: #fff0f2;
}

/* App */
.app-body {
  background:
    linear-gradient(rgba(245, 243, 238, .96), rgba(245, 243, 238, .96)),
    url("images/pijuy-trucks.jpg") center / cover fixed;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(18rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: .8rem max(1rem, calc((100% - 88rem) / 2));
  color: #fff;
  background: rgba(23, 25, 28, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.simple-header {
  grid-template-columns: auto auto;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.app-brand img {
  width: 3rem;
  height: 3rem;
  border-radius: .5rem;
  object-fit: cover;
}

.app-brand strong,
.app-brand small {
  display: block;
}

.app-brand small {
  color: #b8c0c8;
}

.header-filters {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(10rem, 16rem);
  gap: .75rem;
  justify-content: end;
}

.header-filters label {
  color: #e9edf1;
  font-size: .78rem;
}

.header-filters input,
.header-filters select {
  padding: .58rem .65rem;
  color: #fff;
  background: #2a2f35;
  border-color: #49515a;
}

.header-actions,
.row-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.utility-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  width: min(88rem, calc(100% - 2rem));
  margin: .8rem auto 0;
}

.utility-nav a {
  padding: .48rem .7rem;
  border: 1px solid #d2d6da;
  border-radius: .5rem;
  color: #38414a;
  font-weight: 850;
  text-decoration: none;
  background: rgba(255, 255, 255, .72);
}

.utility-nav a.active,
.utility-nav a:hover {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.workspace {
  width: min(88rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 5rem;
}

.narrow-workspace {
  width: min(64rem, calc(100% - 2rem));
}

.workspace-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.workspace-heading h1 {
  margin-bottom: .4rem;
}

.workspace-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
}

.summary-strip span,
.review-metric {
  display: grid;
  min-width: 8rem;
  gap: .15rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: rgba(255, 255, 255, .9);
}

.summary-strip strong,
.review-metric strong {
  font-size: 1.45rem;
  line-height: 1;
}

.summary-strip span,
.review-metric span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tab-nav {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab-nav a {
  min-width: max-content;
  padding: .75rem 1rem;
  border: 1px solid #ccd2d6;
  border-radius: .5rem;
  color: #3a444d;
  font-weight: 900;
  text-decoration: none;
  background: rgba(255, 255, 255, .78);
}

.tab-nav a.active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.work-panel,
.empty-panel {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 .8rem 1.8rem rgba(28, 31, 36, .06);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.panel-title h2 {
  margin-bottom: 0;
}

.panel-title > span {
  color: var(--muted);
  font-weight: 850;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  align-items: end;
}

.span-2 {
  grid-column: span 2;
}

.span-4 {
  grid-column: 1 / -1;
}

.checkbox-line {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: .55rem;
  padding: .72rem .85rem;
  border: 1px solid #cdd3d8;
  border-radius: .5rem;
  background: #fff;
}

.checkbox-line input {
  width: 1rem;
  height: 1rem;
}

.form-actions {
  grid-column: 1 / -1;
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.modal-open {
  overflow: hidden;
}

.entry-modal {
  width: min(68rem, calc(100% - 1.5rem));
  max-height: min(92vh, 58rem);
  padding: 0;
  border: 0;
  border-radius: .5rem;
  color: var(--ink);
  background: transparent;
}

.entry-modal::backdrop {
  background: rgba(12, 14, 17, .58);
  backdrop-filter: blur(.12rem);
}

.modal-panel {
  display: grid;
  max-height: min(92vh, 58rem);
  gap: 1rem;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .28);
}

.modal-title {
  position: sticky;
  z-index: 2;
  top: -1rem;
  margin: -1rem -1rem 0;
  padding: 1rem;
  border-bottom: 1px solid #e2e5e8;
  background: rgba(255, 255, 255, .98);
}

.state-miles {
  display: grid;
  gap: .65rem;
  align-self: stretch;
  padding: .75rem;
  border: 1px solid #d5dade;
  border-radius: .5rem;
  background: #fafafa;
}

.state-miles-heading,
.state-mile-row {
  display: grid;
  gap: .6rem;
  align-items: end;
}

.state-miles-heading {
  grid-template-columns: minmax(0, 1fr) auto;
}

.state-miles-heading span {
  color: #35404a;
  font-size: .9rem;
  font-weight: 900;
}

.state-mile-row {
  grid-template-columns: minmax(5.5rem, .55fr) minmax(7rem, 1fr) auto;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: .7rem;
  border-bottom: 1px solid #e2e5e8;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: #8d1720;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mini-button {
  display: inline-flex;
  min-height: 2.05rem;
  align-items: center;
  justify-content: center;
  padding: .35rem .6rem;
  border: 1px solid #cdd3d8;
  border-radius: .45rem;
  cursor: pointer;
  color: #27313a;
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
  background: #fff;
}

.mini-button:hover {
  border-color: var(--red);
  color: var(--red-dark);
}

.mini-button.danger {
  color: #8d1720;
  border-color: #e3b8be;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}

.review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.simple-list {
  display: grid;
  gap: .45rem;
}

.simple-list p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: .75rem;
  border: 1px solid #e2e5e8;
  border-radius: .5rem;
  background: #fafafa;
}

.ready-box,
.warning-box {
  padding: 1rem;
  border-radius: .5rem;
}

.ready-box {
  color: #1e4d2a;
  background: #e2f3df;
}

.warning-box {
  color: #6a4012;
  background: #fff0d8;
}

.warning-box ul {
  margin-bottom: 0;
}

code {
  padding: .12rem .28rem;
  border-radius: .3rem;
  background: #eceff1;
}

@media (max-width: 70rem) {
  .landing-intro,
  .landing-band,
  .media-grid,
  .landing-split,
  .process-grid,
  .review-grid,
  .review-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid figure:first-child {
    grid-column: span 2;
  }

  .app-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .header-filters {
    justify-content: stretch;
  }
}

@media (max-width: 48rem) {
  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .landing-hero,
  .landing-intro,
  .landing-media,
  .landing-split,
  .landing-process,
  .landing-cta {
    padding: 1rem;
  }

  .landing-hero {
    min-height: 82vh;
  }

  .landing-copy {
    padding-bottom: 2rem;
  }

  .landing-copy h1,
  .auth-copy h1 {
    font-size: 3rem;
  }

  .landing-intro h2,
  .landing-media h2,
  .landing-split h2,
  .landing-process h2,
  .landing-cta h2 {
    font-size: 2rem;
    overflow-wrap: anywhere;
  }

  .landing-copy p {
    font-size: 1rem;
  }

  .landing-nav {
    align-items: flex-start;
  }

  .landing-nav-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .landing-nav-actions a:not(.button) {
    display: none;
  }

  .landing-brand img {
    width: 3.8rem;
    height: 3.8rem;
  }

  .landing-intro,
  .landing-band,
  .media-grid,
  .landing-split,
  .process-grid,
  .auth-page,
  .entry-form,
  .review-grid,
  .review-columns {
    grid-template-columns: 1fr;
  }

  .media-grid figure,
  .media-grid figure:first-child {
    grid-column: auto;
    min-height: 16rem;
  }

  .auth-page {
    gap: 1.5rem;
    padding: 2rem 0;
  }

  .auth-copy {
    display: none;
  }

  .workspace {
    width: min(100% - 1rem, 88rem);
    padding-top: .8rem;
  }

  .workspace-heading,
  .panel-title,
  .simple-header,
  .header-actions {
    display: grid;
    justify-content: stretch;
  }

  .summary-strip {
    justify-content: stretch;
  }

  .summary-strip span,
  .review-metric {
    min-width: 0;
  }

  .header-filters {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .tab-nav a {
    min-width: 0;
    padding: .65rem .35rem;
    font-size: .82rem;
    text-align: center;
    white-space: normal;
  }

  .button {
    width: 100%;
    white-space: normal;
  }

  .span-2 {
    grid-column: span 1;
  }

  .span-4 {
    grid-column: span 1;
  }

  .state-miles-heading,
  .state-mile-row {
    grid-template-columns: 1fr;
  }

  .entry-modal {
    width: min(100% - .5rem, 68rem);
    max-height: 96vh;
  }

  .modal-panel {
    max-height: 96vh;
    padding: .8rem;
  }

  .modal-title {
    top: -.8rem;
    margin: -.8rem -.8rem 0;
    padding: .8rem;
  }

  .data-table th,
  .data-table td {
    padding: .62rem;
  }
}
