:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d9dee8;
  --accent: #2fc6f6;
  --accent-dark: #1597c7;
  --danger-bg: #fff1f2;
  --danger: #be123c;
  --success-bg: #ecfdf5;
  --success: #047857;
  --info-bg: #eff6ff;
  --info: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.app {
  min-height: 100vh;
  padding: 18px;
}

.app_install {
  max-width: 760px;
  margin: 0 auto;
}

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

h1 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
}

p {
  margin: 0;
  color: var(--muted);
}

.status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.status_info {
  color: var(--info);
  background: var(--info-bg);
  border-color: #bfdbfe;
}

.status_error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #fecdd3;
}

.status_success {
  color: var(--success);
  background: var(--success-bg);
  border-color: #bbf7d0;
}

.content,
.install-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.product-table th,
.product-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.product-table th {
  color: #374151;
  background: #f9fafb;
  font-weight: 600;
}

.product-table__qty,
.product-table__price {
  width: 96px;
  white-space: nowrap;
}

.product-name {
  font-weight: 600;
}

.product-meta,
.save-hint {
  color: var(--muted);
  font-size: 12px;
}

textarea {
  display: block;
  width: 100%;
  min-width: 260px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  color: var(--text);
  font: inherit;
}

textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(47, 198, 246, 0.18);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.button {
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.button_secondary {
  color: var(--text);
  background: #e5e7eb;
}

.button_secondary:hover {
  background: #d1d5db;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.install-card {
  padding: 14px;
}

dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 720px) {
  .app__header,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
