:root {
  --bg: #f5f1e9;
  --bg-2: #efe4d6;
  --card: #ffffff;
  --text: #2a2620;
  --muted: #6b6257;
  --accent: #2f6f6d;
  --accent-2: #d9773a;
  --border: #e2d6c6;
  --shadow: rgba(34, 30, 24, 0.08);
  --radius: 14px;
  --mono: "Cascadia Mono", "Consolas", monospace;
  --sans: "Trebuchet MS", "Lucida Sans", sans-serif;
}

[data-theme="dark"] {
  --bg: #161411;
  --bg-2: #22201c;
  --card: #1f1c17;
  --text: #f5f2ec;
  --muted: #b0a89b;
  --accent: #7cc5c1;
  --accent-2: #f0a26a;
  --border: #3a332a;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-2), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(47, 111, 109, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .nav {
  background: rgba(22, 20, 17, 0.8);
}

.nav-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px var(--shadow);
}

.button.primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.button.secondary {
  background: var(--accent-2);
  color: white;
  border-color: transparent;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 24px var(--shadow);
}

.card + .card {
  margin-top: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 109, 0.12);
  color: var(--accent);
  font-size: 12px;
}

.item-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.item-content {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.item-content.collapsed {
  max-height: 140px;
  overflow: hidden;
  position: relative;
}

.item-content.collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--card));
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.notice {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(217, 119, 58, 0.15);
  color: var(--accent-2);
  margin-bottom: 12px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.dropzone.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(47, 111, 109, 0.08);
}

.hidden {
  display: none;
}

.code-block {
  font-family: var(--mono);
  font-size: 13px;
  background: rgba(47, 111, 109, 0.08);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
}

footer {
  margin-top: 32px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

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