:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2a3544;
  --text: #e7ecf3;
  --muted: #8b9bb0;
  --accent: #3d9cf0;
  --accent-soft: rgba(61, 156, 240, 0.15);
  --ok: #3dd68c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(61, 156, 240, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(61, 214, 140, 0.08), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

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

.product {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.product.error {
  border-color: rgba(240, 113, 120, 0.35);
}

.product-media {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background: #111820;
  border: 1px solid var(--border);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-label {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-body h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 6px;
}

.product-price {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ok);
}

.product-old-price {
  color: var(--muted);
  text-decoration: line-through;
}

.product-discount {
  font-size: 0.75rem;
  font-weight: 700;
  color: #041018;
  background: var(--ok);
  border-radius: 999px;
  padding: 2px 8px;
}

.product-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.product-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.product-link:hover {
  text-decoration: underline;
}

.compose {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.compose-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.compose textarea,
.compose input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
}

.compose textarea:focus,
.compose input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.compose-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.compose-row input {
  flex: 1;
  min-width: 0;
}

.compose button {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #041018;
  font: inherit;
  font-weight: 650;
  padding: 0 18px;
  cursor: pointer;
  min-height: 44px;
}

.compose button:hover:not(:disabled) {
  filter: brightness(1.08);
}

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

.form-hint {
  min-height: 1.25em;
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-hint.ok {
  color: var(--ok);
}

.form-hint.err {
  color: #f07178;
}

.author-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge.web {
  color: var(--ok);
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.1);
}

.badge.tg {
  color: var(--accent);
  border-color: rgba(61, 156, 240, 0.35);
  background: var(--accent-soft);
}

h1 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status.live .dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.25);
}

.status.error .dot {
  background: #f07178;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  animation: in 0.25s ease;
}

@keyframes in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.author {
  color: var(--accent);
  font-weight: 600;
}

.text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1.05rem;
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.hidden {
  display: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 540px) {
  .header {
    flex-direction: column;
  }

  h1 {
    font-size: 1.4rem;
  }

  .product {
    grid-template-columns: 88px 1fr;
    padding: 14px;
  }

  .product-media {
    width: 88px;
    height: 88px;
  }

  .product-price {
    font-size: 1.35rem;
  }

  .compose-row {
    flex-direction: column;
  }

  .compose button {
    width: 100%;
  }
}
