:root {
  --bg: #f8f8f5;
  --text: #1c1e1a;
  --muted: #57615a;
  --line: #cad3cb;
  --accent: #1f6a4d;
  --accent-soft: #e3efe8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 0 0, #ecf2ee 0%, var(--bg) 38%);
  line-height: 1.45;
}

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

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

a {
  color: var(--text);
}

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.1rem 2.6rem;
}

.shell-wide {
  max-width: 1020px;
}

.masthead {
  padding: 1rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
}

.masthead.slim {
  padding-top: 0.4rem;
}

.inline-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.subtle,
.muted {
  color: var(--muted);
  margin-top: 0.5rem;
}

.quick-links {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.quick-link {
  display: block;
  padding: 0.9rem 1rem;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.quick-link:hover {
  border-color: var(--accent);
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.93rem;
  color: var(--muted);
}

.stack {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.55rem;
}

input,
select,
button,
textarea {
  width: 100%;
  padding: 0.68rem 0.72rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0;
  font: inherit;
  color: var(--text);
}

input:focus,
select:focus,
button:focus,
textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

button {
  cursor: pointer;
  width: auto;
  background: var(--accent-soft);
}

button:hover {
  background: #d5e8dd;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suggestion-chip {
  width: auto;
  padding: 0.42rem 0.66rem;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
}

.inline-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-controls label {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.selected-list,
.plain-list {
  display: grid;
  gap: 0.5rem;
}

.selected-item,
.line-item {
  border: 1px solid var(--line);
  padding: 0.6rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
}

.selected-item strong {
  min-width: 140px;
}

.estimate {
  color: var(--accent);
  font-weight: 700;
}

.grid-form {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.grid-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.full-width {
  grid-column: 1 / -1;
}

.grid-form button {
  grid-column: 1 / -1;
  justify-self: start;
}

.store-layout {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.qty-input {
  width: 68px;
}

.metrics {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.5rem;
}

.metric {
  border: 1px solid var(--line);
  padding: 0.55rem;
  display: grid;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.65);
}

.metric strong {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.52rem 0.6rem;
  vertical-align: top;
}

th {
  font-weight: 700;
  background: #eef3ef;
}

.error {
  color: #8f2323;
}

@media (max-width: 860px) {
  .store-layout {
    grid-template-columns: 1fr;
  }

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

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

  .inline-header {
    display: block;
  }

  .selected-item,
  .line-item {
    display: grid;
    align-items: stretch;
  }
}

.block {
  border: 1px solid var(--line);
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.64);
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.mini-link {
  font-size: 0.85rem;
  margin-right: 0.4rem;
  color: var(--accent);
  text-decoration: underline;
}

textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.68rem 0.72rem;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  color: var(--text);
}

.has-sticky-cta .shell {
  padding-bottom: 8.6rem;
}

.sticky-estimate-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: rgba(248, 248, 245, 0.98);
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.sticky-estimate-bar > div {
  min-width: 0;
}

.sticky-estimate-bar .muted {
  margin-top: 0;
  font-size: 0.85rem;
}

.sticky-total {
  margin-top: 0.1rem;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

@media (max-width: 640px) {
  .has-sticky-cta .shell {
    padding-bottom: 9.8rem;
  }

  .sticky-estimate-bar {
    padding: 0.62rem 0.8rem;
  }

  .sticky-estimate-bar button {
    padding: 0.62rem 0.72rem;
  }
}
