* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #ffffff;
  color: #000000;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 560px);
  border: 1px solid #000000;
  background: #ffffff;
  border-radius: 6px;
  padding: 28px;
}

.card-compact {
  width: min(100%, 520px);
}

.card-wide {
  width: min(100%, 1180px);
}

.badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border: 1px solid #000000;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
}

h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
}

.hint {
  margin: 0 0 18px;
  color: #000000;
}

.instructions {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #000000;
  border-radius: 6px;
  color: #000000;
  font-size: 14px;
  line-height: 1.45;
}

.instructions p {
  margin: 0 0 8px;
}

.instructions p:last-child {
  margin-bottom: 0;
}

.confirmation-panel {
  display: grid;
  gap: 14px;
}

.summary-list {
  display: grid;
  border: 1px solid #000000;
  border-radius: 6px;
}

.summary-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #000000;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row span {
  font-size: 14px;
  font-weight: 700;
}

.summary-row strong {
  overflow-wrap: anywhere;
}

.confirm-note {
  margin: 0;
  border: 1px solid #b7791f;
  border-radius: 6px;
  padding: 12px;
  color: #8a4f00;
  font-size: 14px;
  line-height: 1.45;
}

.form {
  display: grid;
  gap: 10px;
}

.form-note {
  margin: -2px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stock-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.stock-actions button {
  width: auto;
  padding: 10px 14px;
  font-size: 14px;
}

label {
  font-size: 14px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid #000000;
  background: #ffffff;
  color: #000000;
  border-radius: 4px;
  padding: 12px;
  font-size: 15px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 1px solid #000000;
  border-color: #000000;
}

button {
  border: 1px solid #000000;
  border-radius: 4px;
  padding: 13px;
  background: #000000;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 1;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.secondary-button {
  background: #ffffff;
  color: #000000;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.mode-option {
  min-width: 150px;
  background: #ffffff;
  color: #000000;
}

.mode-option.is-active {
  background: #000000;
  color: #ffffff;
}

.language-option {
  display: grid;
  gap: 6px;
  text-align: left;
  background: #ffffff;
  color: #000000;
  min-height: 138px;
  align-content: start;
}

.language-flag {
  width: 42px;
  height: 32px;
  display: block;
  border: 1px solid #000000;
  border-radius: 4px;
  object-fit: cover;
}

.language-option:hover {
  background: #f3f3f3;
}

.language-name {
  font-size: 18px;
  font-weight: 700;
}

.language-description {
  font-size: 14px;
  font-weight: 400;
}

.message {
  min-height: 24px;
  margin: 12px 0 0;
  font-size: 14px;
}

.message.error {
  color: #000000;
}

.message.success {
  color: #000000;
}

.message.info {
  color: #000000;
}

.result-card {
  margin-top: 14px;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
}

.result-card p {
  margin: 0 0 8px;
}

.result-card p:last-child {
  margin-bottom: 0;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-toolbar p {
  margin: 0;
}

.copy-button {
  width: auto;
  padding: 9px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.stock-updated {
  color: #555555;
  font-size: 13px;
}

.stock-result {
  margin-top: 14px;
}

.stock-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.stock-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.stock-heading p {
  margin: 0;
  color: #555555;
  font-size: 14px;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stock-card {
  display: grid;
  gap: 18px;
  min-height: 166px;
  align-content: start;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 20px;
  background: #ffffff;
}

.stock-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.stock-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.stock-status {
  flex: 0 0 auto;
  max-width: 132px;
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #000000;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.stock-status.status-available {
  border-color: #15803d;
  background: #15803d;
  color: #ffffff;
}

.stock-status.status-used {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.stock-status.status-low {
  border-color: #b7791f;
  background: #b7791f;
  color: #ffffff;
}

.stock-note {
  margin: 0;
  min-height: 42px;
  color: #222222;
  font-size: 16px;
  line-height: 1.4;
}

.stock-card-meta {
  margin: 0;
  color: #555555;
  font-size: 15px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
  table-layout: fixed;
  min-width: 760px;
}

.result-table th,
.result-table td {
  border: 1px solid #000000;
  padding: 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-table th {
  background: #f3f3f3;
}

.status-pill {
  display: inline-block;
  min-width: 96px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-weight: 700;
  text-align: center;
}

.status-available {
  color: #15803d;
}

.status-used {
  color: #b91c1c;
}

.status-low {
  color: #a16207;
}

.status-neutral {
  color: #000000;
}

.result-table th:nth-child(1),
.result-table td:nth-child(1) {
  width: 30%;
}

.result-table th:nth-child(2),
.result-table td:nth-child(2) {
  width: 18%;
}

.result-table th:nth-child(3),
.result-table td:nth-child(3) {
  width: 32%;
}

.result-table th:nth-child(4),
.result-table td:nth-child(4) {
  width: 20%;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  color: #000000;
  text-decoration: underline;
  font-size: 14px;
}

.text-button {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000000;
  text-align: left;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 400;
}

.hidden {
  display: none;
}

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

@media (max-width: 640px) {
  h1 {
    font-size: 25px;
  }

  .card {
    padding: 18px;
  }

  .card-wide {
    width: 100%;
  }

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

  .button-row {
    grid-template-columns: 1fr;
  }

  .summary-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .stock-actions {
    justify-content: stretch;
  }

  .stock-actions button {
    width: 100%;
  }

  .stock-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

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

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }
}
