*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f7;
  color: #222;
}

a {
  color: #0c5db3;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.top-bar {
  background: #111;
  color: #eee;
}

.top-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  color: #fff;
  font-weight: 600;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.top-nav a {
  color: #ddd;
}

.top-nav a:hover {
  color: #fff;
}

.nav-user {
  color: #aaa;
}

.page {
  max-width: 960px;
  margin: 1rem auto 2rem;
  padding: 0 1rem;
}

.page-title {
  margin: 0 0 1rem;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.item-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #ddd;
}

.item-image img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 2px;
}

.placeholder-image {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: #e0e0e0;
  font-size: 0.75rem;
  color: #555;
}

.placeholder-image.large {
  width: 100%;
  max-width: 280px;
  height: 200px;
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.item-meta,
.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #555;
}

.auth-box,
.narrow {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  padding: 1rem;
  border: 1px solid #ddd;
}

.auth-box h1,
.narrow h1 {
  margin-top: 0;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  padding: 0.4rem 0.5rem;
  border-radius: 2px;
  border: 1px solid #bbb;
  font: inherit;
}

button {
  padding: 0.4rem 0.8rem;
  border-radius: 2px;
  border: 1px solid #0c5db3;
  background: #0c5db3;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

button:hover {
  background: #0a4a8f;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
}

.checkbox-label input {
  margin-right: 0.5rem;
}

.help-text {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 0.5rem;
}

.bulk-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.bulk-row label {
  margin: 0;
}

.bulk-row .btn-remove-tier {
  background: #777;
  border-color: #666;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.bulk-row .btn-remove-tier:hover {
  background: #555;
}

#add-tier-btn.btn-secondary {
  background: #5cb85c;
  border-color: #4cae4c;
  margin-top: 0.25rem;
}

#add-tier-btn.btn-secondary:hover {
  background: #449d44;
}

.flash {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 2px;
  font-size: 0.9rem;
}

.flash-success {
  background: #e6f7ea;
  border: 1px solid #5cb85c;
}

.flash-error {
  background: #fdecea;
  border: 1px solid #d9534f;
}

.flash-info {
  background: #e8f4fd;
  border: 1px solid #5bc0de;
}

.product-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-main {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-gallery {
  flex: 0 0 280px;
}

.product-gallery img {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin-bottom: 0.5rem;
  border-radius: 2px;
}

.product-summary {
  flex: 1;
  min-width: 0;
}

.product-vendor {
  font-size: 0.9rem;
  color: #555;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 600;
}

.product-description {
  margin-top: 0.75rem;
  white-space: pre-wrap;
}

.product-reviews {
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
}

.review-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.review {
  border-top: 1px solid #eee;
  padding: 0.5rem 0;
}

.review:first-child {
  border-top: none;
}

.review-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.review-comment {
  margin: 0.25rem 0;
}

.review-date {
  font-size: 0.8rem;
  color: #777;
}

.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.simple-list li {
  padding: 0.3rem 0;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
}

.simple-list li:first-child {
  border-top: none;
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.plain-table th,
.plain-table td {
  border: 1px solid #ddd;
  padding: 0.4rem 0.5rem;
}

.plain-table th {
  background: #f2f2f2;
  text-align: left;
}

.cart-total {
  margin-top: 0.75rem;
}

.admin-section {
  margin-bottom: 1.5rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.admin-nav a {
  font-weight: 500;
}

.wallet-summary {
  margin-bottom: 1rem;
}

.wallet-summary p {
  margin: 0.25rem 0;
}

.muted {
  color: #777;
  font-size: 0.85rem;
}

.btn-danger {
  background: #c9302c;
  border-color: #ac2925;
}

.btn-danger:hover {
  background: #a94442;
}

@media (max-width: 640px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .item-card {
    flex-direction: row;
  }
}

