@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@700&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f2e8;
  --panel: #fffdf8;
  --line: #d8cfbf;
  --text: #2f261b;
  --muted: #6f6355;
  --accent: #5f6f3c;
  --accent-hover: #4f5d31;
  --danger: #a83c3c;
  --danger-soft: #fbe7e7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #fbf7ef 0%, var(--bg) 55%, #f4eee2 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 242, 232, 0.92);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid rgba(216, 207, 191, 0.9);
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-family: Merriweather, Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.top-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
}

.top-links a:hover {
  background: rgba(95, 111, 60, 0.12);
}

main.container {
  padding-block: 1.45rem 2.2rem;
}

h1,
h2,
h3 {
  font-family: Merriweather, Georgia, serif;
  line-height: 1.25;
}

h1 {
  font-size: clamp(1.5rem, 2vw, 1.95rem);
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.12rem;
  margin: 0 0 0.55rem;
}

.page-intro {
  margin-bottom: 1.1rem;
}

.toolbar {
  margin-bottom: 1.15rem;
  display: grid;
  gap: 0.72rem;
}

.search-form {
  display: flex;
  gap: 0.6rem;
}

.search-form input {
  flex: 1;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.actions form {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.actions form input[type="password"] {
  min-width: 13rem;
}

.panel,
.recipe-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.recipe-list {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recipe-card h2 {
  margin: 0 0 0.45rem;
}

.recipe-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.recipe-card h2 a:hover {
  color: var(--accent);
}

.preview {
  margin: 0.1rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0.8rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c8bfaf;
  background: #faf6ee;
  color: #4a3e32;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.meta-channel {
  border-color: #b7c49a;
  background: #f2f7e8;
  color: #42522a;
  order: -1;
}

.details-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

form.stack {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbbfae;
  border-radius: 10px;
  padding: 0.66rem 0.76rem;
  background: #fff;
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(95, 111, 60, 0.2);
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

button,
.button-link {
  border-radius: 10px;
  padding: 0.58rem 0.92rem;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  border-color: #b8ab99;
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(95, 111, 60, 0.08);
}

.btn-danger {
  background: var(--danger-soft);
  border: 1px solid #e8b5b5;
  color: var(--danger);
}

.btn-danger:hover {
  background: #f8dada;
}

.recipe-layout {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 1rem;
}

.recipe-side {
  border-right: 1px dashed #d4c8b7;
  padding-right: 1rem;
}

.line-list {
  margin: 0.2rem 0 1rem;
  padding-left: 1.2rem;
}

.line-list li {
  margin-bottom: 0.42rem;
}

.form-panel {
  max-width: 760px;
}

.multiline {
  white-space: pre-wrap;
  margin: 0.25rem 0 1rem;
}

.error {
  color: var(--danger);
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.empty,
.muted {
  color: var(--muted);
}

.skill-doc {
  white-space: pre-wrap;
  background: #f8f3ea;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.82rem;
  overflow-x: auto;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .recipe-list {
    grid-template-columns: 1fr;
  }

  .recipe-layout {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .recipe-side {
    border-right: 0;
    border-top: 1px dashed #d4c8b7;
    padding-right: 0;
    padding-top: 0.9rem;
  }
}

@media (max-width: 640px) {
  .search-form {
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 0.6rem 0;
  }
}
