:root {
  --bg: #0b0c0e;
  --surface: #14161a;
  --surface2: #1c1f26;
  --border: #2e333d;
  --text: #e6e4e2;
  --muted: #8b909a;
  --accent: #b33a3a;
  --ok: #4caf82;
  --warn: #c9a24a;
  --bad: #e85c5c;
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  display: grid;
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.grid-limits {
  display: grid;
  gap: 1rem;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--mono);
}

.panel-body {
  padding: 0.85rem 1rem;
}

.limits-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 700px) {
  .limits-row {
    grid-template-columns: 1fr;
  }
}

.field-label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.field-label.grow {
  flex: 1;
  min-width: 12rem;
}

.input,
.textarea {
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.textarea {
  font-family: var(--mono);
  font-size: 0.82rem;
  resize: vertical;
  line-height: 1.4;
}

.hint {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.hint code {
  color: var(--warn);
  font-family: var(--mono);
  font-size: 0.9em;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.pack-actions {
  margin-top: 0;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(179, 58, 58, 0.7);
}

.btn-primary {
  background: rgba(179, 58, 58, 0.22);
  border-color: rgba(179, 58, 58, 0.65);
  color: #f2d8d8;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
}

.parse-summary {
  font-size: 0.8rem;
}

.muted {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.load-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
}

.load-card:last-child {
  margin-bottom: 0;
}

.load-card.is-posted {
  background: rgba(76, 175, 130, 0.12);
  border-color: rgba(76, 175, 130, 0.5);
}

.load-stats .pull-copy-stat {
  display: inline;
  padding: 0.05rem 0.2rem;
  font-size: inherit;
}

.load-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.load-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.load-stats {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.load-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.load-table th,
.load-table td {
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid rgba(46, 51, 61, 0.85);
  text-align: left;
}

.load-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.load-table td.num {
  font-family: var(--mono);
  text-align: right;
  white-space: nowrap;
}

.pull-copy {
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: var(--mono);
  text-align: inherit;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}

.pull-copy:hover {
  background: rgba(179, 58, 58, 0.14);
}

.pull-copy-name {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.item-name-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 0.15rem;
}

.full-stack {
  display: inline-block;
  flex-shrink: 0;
  margin-left: 0.05rem;
  font-size: 0.55rem;
  color: var(--warn);
  line-height: 1;
  cursor: help;
}

.load-table .pull-copy {
  width: 100%;
}

.item-name-cell .pull-copy {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
}

.pull-copy-qty {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pull-copy.is-done {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.75;
}

.leftover-block {
  margin-top: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(201, 162, 74, 0.35);
  border-radius: 6px;
  background: rgba(201, 162, 74, 0.06);
  font-size: 0.85rem;
}

.leftover-block strong {
  color: var(--warn);
}
