:root {
  --bg: #f6f1e9;
  --panel: #fffaf3;
  --ink: #1f2a37;
  --muted: #59697c;
  --accent: #b07a32;
  --accent-strong: #8c5226;
  --warn: #d97706;
  --ok: #065f46;
  --error: #b91c1c;
  --line: #e7d9c7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, #fef3c7 0%, transparent 34%),
    radial-gradient(circle at 100% 0%, #ffe4e6 0%, transparent 30%),
    var(--bg);
}

.container {
  width: min(1240px, 94vw);
  margin: 0 auto;
  padding: 18px 0 40px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 12px 30px -20px rgba(0, 0, 0, 0.5);
}

.narrow {
  max-width: 480px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 10px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.45rem 0 0.2rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8c7af;
  background: #fff;
  border-radius: 10px;
  padding: 0.6rem 0.68rem;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 122, 50, 0.2);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.58rem 0.9rem;
  color: #fff;
  background: linear-gradient(130deg, var(--accent), var(--accent-strong));
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn.secondary,
.btn.muted {
  background: #fff;
  color: var(--accent-strong);
}

.alert {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.alert.error {
  background: #fee2e2;
  color: #7f1d1d;
}

.alert.success {
  background: #dcfce7;
  color: #14532d;
}

.status {
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.status.ok {
  border-color: #86efac;
  color: var(--ok);
  background: #ecfdf5;
}

.status.warn {
  border-color: #fcd34d;
  color: #92400e;
  background: #fffbeb;
}

.status.error {
  border-color: #fca5a5;
  color: var(--error);
  background: #fef2f2;
}

.status.loading {
  border-color: #93c5fd;
  color: #1e3a8a;
  background: #eff6ff;
}

.preview-wrap {
  min-height: 240px;
  border: 1px dashed #ceb79a;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  background: #fff;
}

.preview-wrap img {
  max-width: 100%;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #171717;
  color: #fafafa;
  padding: 10px;
  border-radius: 10px;
}

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

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

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