:root {
  color-scheme: light;
  --bg: #fbfaf4;
  --surface: #ffffff;
  --surface-soft: #f2efe5;
  --text: #24312d;
  --muted: #66736c;
  --line: #d9d5c8;
  --leaf: #2f6d52;
  --leaf-dark: #1f523d;
  --carrot: #c86f2f;
  --carrot-soft: #fff0e3;
  --sky-soft: #eaf4f1;
  --danger: #ad3b35;
  --shadow: 0 12px 30px rgba(36, 49, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 244, 0.95);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hero {
  padding: 30px 0 18px;
}

.hero h1,
.page-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 2.8rem, 2.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.hero p,
.lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.12rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.button,
.button-secondary,
.button-ghost,
.button-danger {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
}

.button {
  background: var(--leaf);
  color: #fff;
}

.button:hover,
.button:focus-visible {
  background: var(--leaf-dark);
}

.button-secondary {
  background: var(--carrot-soft);
  color: #713d19;
  border-color: #efc59c;
}

.button-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button-danger {
  background: #fff4f2;
  color: var(--danger);
  border-color: #e8bbb6;
}

.button[disabled],
.button-secondary[disabled],
.button-ghost[disabled],
.button-danger[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 16px;
}

.post-image,
.preview-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-soft);
}

.post-title {
  margin: 0 0 8px;
  font-size: 1.28rem;
  line-height: 1.35;
}

.meta {
  color: var(--muted);
  font-size: 0.98rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--sky-soft);
  color: #244f46;
  font-weight: 700;
  font-size: 0.9rem;
}

.like-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.like-button {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e6b8bc;
  background: #fff5f6;
  color: #9d3345;
  font-weight: 900;
}

.like-button.active {
  background: #9d3345;
  color: #fff;
  border-color: #9d3345;
}

.section {
  padding: 18px 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: start;
}

.recipe-block {
  margin: 0 0 20px;
}

.recipe-block ul,
.recipe-block ol {
  margin: 8px 0 0;
  padding-left: 1.4rem;
}

.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 900;
}

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

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  min-height: 48px;
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.file-input {
  width: 100%;
  padding: 12px;
  border: 1px dashed #b9b19e;
  border-radius: 8px;
  background: #fff;
}

.notice {
  border-left: 5px solid var(--carrot);
  background: var(--carrot-soft);
  padding: 12px 14px;
  border-radius: 8px;
  margin: 18px 0;
}

.notice p,
.notice ul {
  margin: 6px 0;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.55);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 900;
  background: var(--sky-soft);
  color: #244f46;
}

.status-pill.hidden {
  background: #f4e2df;
  color: var(--danger);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 18px;
}

.segmented {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.segmented button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 12px;
  font-weight: 800;
}

.segmented button.active {
  border-color: var(--leaf);
  background: var(--leaf);
  color: #fff;
}

.error,
.success {
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  font-weight: 800;
}

.error {
  background: #fff0ee;
  color: var(--danger);
}

.success {
  background: #ecf6ef;
  color: var(--leaf-dark);
}

.loading {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.admin-row img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.small {
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
    width: 100%;
  }

  .nav .button-ghost,
  .nav .button-secondary {
    flex: 1 1 130px;
  }

  .hero h1,
  .page-title {
    font-size: 2rem;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .admin-row img {
    width: 92px;
    height: 76px;
  }

  .admin-row .actions {
    grid-column: 1 / -1;
    margin: 4px 0 0;
  }

  .button,
  .button-secondary,
  .button-ghost,
  .button-danger {
    width: 100%;
  }
}
