:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --line: #dfe3e7;
  --text: #1f2328;
  --muted: #6a737d;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16833a;
  --orange: #c56a13;
  --red: #c9252d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #fbfbfc;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  gap: 24px;
  align-content: start;
  padding: 32px;
}

.status-panel,
.print-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.status-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--orange);
}

.dot.ready {
  background: var(--green);
}

.dot.error {
  background: var(--red);
}

.status-row p,
.section-heading p,
.match-card p {
  margin-top: 4px;
  color: var(--muted);
}

dl {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

dl div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(37, 99, 235, 0.16);
}

.quantity-field {
  max-width: 140px;
}

.button-row {
  display: flex;
  gap: 10px;
}

button {
  min-height: 38px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: var(--blue-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

button.secondary {
  border-color: #cbd2d9;
  background: #fff;
  color: var(--text);
}

button.secondary:hover {
  background: #eef1f4;
}

.section-heading {
  display: grid;
  gap: 4px;
}

.match-card {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.match-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hidden {
  display: none;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.history-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.history-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.history-item strong {
  display: block;
}

.history-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .shell,
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
