:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

#subtitle,
.muted,
.meta,
small {
  color: #627080;
}

button,
input,
select {
  min-height: 44px;
  border: 1px solid #c8d0d8;
  border-radius: 6px;
  background: white;
  color: #17202a;
  font: inherit;
}

button {
  padding: 0 14px;
  background: #1463ff;
  border-color: #1463ff;
  color: white;
  font-weight: 700;
}

button:disabled {
  background: #d5dbe3;
  border-color: #d5dbe3;
  color: #758292;
}

input,
select {
  padding: 0 10px;
}

.panel,
.order,
.product,
.job {
  background: white;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}

.panel {
  padding: 14px;
}

.panel input,
.panel button {
  width: 100%;
  margin-top: 10px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.tabs button {
  background: white;
  color: #27313d;
  border-color: #c8d0d8;
}

.tabs button.active {
  background: #17202a;
  border-color: #17202a;
  color: white;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 10px;
}

.qty {
  width: 72px;
}

.message {
  min-height: 22px;
  margin: 8px 0;
  color: #627080;
}

.message.ok {
  color: #0d7a3d;
}

.message.error {
  color: #b42318;
}

.list {
  display: grid;
  gap: 8px;
}

.order,
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  align-items: center;
}

.product {
  grid-template-columns: 54px minmax(0, 1fr) auto;
}

.product img,
.image-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: #e7ebf0;
  object-fit: cover;
}

.order-top,
.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.order ul {
  padding-left: 18px;
  margin: 8px 0;
}

.product-main,
.order-main {
  min-width: 0;
}

.product-main strong,
.order-main strong {
  display: block;
  overflow-wrap: anywhere;
}

.meta {
  font-size: 13px;
  margin-top: 4px;
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 8px 10px;
}

.service-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: white;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}

.service-item p {
  margin-top: 4px;
  color: #627080;
  font-size: 14px;
}

.job small {
  grid-column: 1 / -1;
}

.empty {
  padding: 20px;
  text-align: center;
  color: #627080;
}

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  main {
    padding: 10px;
  }

  header {
    align-items: flex-start;
  }

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

  .qty {
    width: 100%;
  }

  .order,
  .product,
  .service-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .product {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .product button {
    grid-column: 1 / -1;
  }
}
