:root {
  --ink: #17201b;
  --muted: #677169;
  --paper: #f4efe5;
  --panel: #fffaf0;
  --line: #ded3c0;
  --green: #176b4c;
  --gold: #f1b73c;
  --red: #c94235;
  --shadow: 0 18px 45px rgba(30, 25, 15, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: #17201b;
  color: #fffaf0;
  box-shadow: 0 10px 30px rgba(23, 32, 27, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 950;
}

.brand p,
.brand span,
.eyebrow {
  margin: 0;
}

.brand p {
  font-weight: 950;
  font-size: 1.1rem;
}

.brand span,
.net-pill span {
  color: #d5ddcf;
  font-size: 0.84rem;
}

.net-pill {
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.09);
}

.net-pill strong {
  display: block;
  font-size: 1.55rem;
}

.net-pill strong.negative {
  color: #ffb5aa;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  padding: 22px;
}

.viewer-panel,
.side-panel {
  min-width: 0;
}

.side-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 14px;
}

.viewer-head,
.card-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.card-title-row {
  align-items: center;
}

.eyebrow {
  color: var(--red);
  font-weight: 950;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
}

h2 {
  font-size: 1.35rem;
}

.store-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-tabs button,
.folder-launch a,
.add-form button,
.ghost,
.stepper button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.store-tabs button.active {
  background: var(--store);
  color: #fff;
  border-color: var(--store);
}

.folder-launch a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.folder-launch {
  display: grid;
  gap: 12px;
  min-height: 260px;
  align-content: center;
  justify-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 107, 76, 0.08), transparent 35%),
    #fffdf8;
  box-shadow: var(--shadow);
}

.offers-section {
  margin-top: 18px;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.offer-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.store-label {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--store);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.offer-card h3 {
  margin: 10px 0 0;
  font-size: 1.22rem;
  line-height: 1.12;
}

.offer-card p {
  margin: 7px 0 0;
  color: var(--muted);
}

.offer-price strong {
  display: block;
  font-size: 2rem;
}

.offer-price span {
  color: var(--green);
  font-weight: 900;
}

.offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-actions button,
.offer-actions a {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.offer-actions button {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.offer-actions a {
  display: inline-flex;
  align-items: center;
  color: #0b6aa8;
}

.folder-launch p {
  max-width: 680px;
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.5rem);
  font-weight: 950;
  line-height: 1.1;
}

.folder-launch span {
  color: var(--muted);
  max-width: 640px;
}

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.add-form,
.trip-form,
.items-list {
  display: grid;
  gap: 10px;
}

.add-form label,
.trip-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

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

.add-form input,
.with-unit {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.add-form input {
  padding: 0 12px;
}

.with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
}

.with-unit input {
  min-height: 42px;
  border: 0;
  padding: 0 12px;
  outline: 0;
  background: transparent;
}

.with-unit b {
  padding-right: 12px;
}

.add-form button {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.item-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.stepper button {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.totals {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.totals strong {
  color: var(--ink);
}

.totals .net {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 950;
}

.empty {
  padding: 16px;
  border: 1px dashed #b9ad9c;
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

@media (max-width: 1080px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .folder-launch {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .viewer-head,
  .card-title-row,
  .item-row {
    align-items: stretch;
    flex-direction: column;
  }

  .net-pill {
    width: 100%;
  }

  .app-grid {
    padding: 14px;
  }

  .split {
    grid-template-columns: 1fr;
  }
}
