:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1a1d21;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #146ef5;
  --primary-soft: #eef4ff;
  --success: #16883f;
  --danger: #c62828;
  --danger-soft: #fff1f0;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
}
.header { padding: 4px 2px 2px; }
.header h1 { margin: 0 0 4px; font-size: 1.4rem; line-height: 1.25; }
.muted { color: var(--muted); margin: 0; font-size: 0.92rem; }
.small { margin-top: 8px; font-size: 0.82rem; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.error-card { border-color: #ffc9c5; background: var(--danger-soft); }
.error-card h2 { color: var(--danger); margin: 0 0 8px; }
.error-card p { margin: 6px 0 0; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
}
.qty-label { margin-top: 14px; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 110, 245, 0.12);
}
.employee-name {
  margin: 0;
  padding: 11px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-weight: 650;
}

.row { display: flex; gap: 10px; }
.row.between { align-items: center; justify-content: space-between; }
h2 { margin: 0; font-size: 1.02rem; }

.suggestions {
  margin-top: 8px;
  max-height: 250px;
  overflow: auto;
  border-radius: 11px;
}
.suggestion {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-top: none;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.suggestion:first-child { border-top: 1px solid var(--line); border-radius: 11px 11px 0 0; }
.suggestion:last-child { border-radius: 0 0 11px 11px; }
.suggestion:only-child { border-radius: 11px; }
.suggestion:hover, .suggestion.selected { background: var(--primary-soft); }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 46px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.success { background: var(--success); color: #fff; }
.btn.ghost {
  width: auto;
  min-height: auto;
  margin: 0;
  background: transparent;
  color: var(--danger);
  padding: 7px 9px;
  font-size: 0.86rem;
}
.btn:disabled { opacity: 0.48; cursor: not-allowed; }

.cart { list-style: none; margin: 12px 0 0; padding: 0; }
.cart li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.cart li:last-child { border-bottom: none; }
.cart-article { overflow-wrap: anywhere; }
.cart-qty { font-variant-numeric: tabular-nums; }
.cart-delete {
  border: none;
  background: #f2f4f7;
  color: var(--danger);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  font-size: 0.88rem;
  margin: 12px 0 0;
  max-height: 280px;
  overflow: auto;
}
.sticky {
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 3;
}
