:root {
  --ink: #402b1d;
  --brown: #744b2d;
  --cream: #f6eee4;
  --line: #dfd3c7;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; background: #faf7f2; color: var(--ink); }
a { color: var(--brown); }
header { display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; background: white; border-bottom: 1px solid var(--line); }
.brand { font: 32px Georgia, serif; text-decoration: none; }
.brand small { display: block; font: 12px system-ui; letter-spacing: .15em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 15px 5%; background: var(--cream); }
nav a { text-decoration: none; font-weight: 600; }
nav form { margin-left: auto; }
main { max-width: 1280px; padding: 28px; margin: auto; }
h1 { font: 36px Georgia, serif; }
h2 { font-size: 21px; }
.panel { background: white; padding: 24px; border: 1px solid var(--line); border-radius: 16px; margin: 20px 0; }
.narrow { max-width: 520px; margin: 30px auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.stat strong { display: block; font-size: 30px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
label { display: block; font-weight: 600; margin-bottom: 16px; }
input, select, textarea { display: block; width: 100%; padding: 10px 12px; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: white; }
input[type=checkbox] { display: inline-block; width: auto; margin-right: 8px; }
textarea { min-height: 100px; }
button, .button { display: inline-block; padding: 10px 18px; border: 0; border-radius: 9px; background: var(--brown); color: white; font: inherit; text-decoration: none; cursor: pointer; }
.secondary { background: #e9dfd4; color: var(--ink); }
.notice { background: #e6efdf; padding: 14px; border-radius: 9px; }
.error { background: #ffe6df; padding: 14px; border-radius: 9px; }
.table-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th, td { text-align: left; padding: 13px; border-bottom: 1px solid var(--line); }
th { background: var(--cream); }
td img { width: 52px; height: 62px; object-fit: cover; border-radius: 7px; }
.preview { max-width: 230px; max-height: 260px; object-fit: contain; border-radius: 10px; }
.muted { color: #846f60; font-size: 13px; }
.badge { background: var(--cream); border-radius: 20px; padding: 4px 10px; font-size: 12px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.details p { overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #a87958; outline-offset: 3px; }

.content-sections { display: grid; gap: 4px; }
.content-section { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 28px; }
.content-section-heading h2 { margin-top: 0; }
.content-section-heading p { margin-bottom: 0; }
.content-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.content-wide-field, .content-image-field { grid-column: 1 / -1; }
.content-image-field { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 20px; padding: 14px; background: var(--cream); border-radius: 12px; }
.content-image-field label { margin: 0; }
.content-image-field .muted { grid-column: 2; margin: -10px 0 0; }
.content-image-preview { width: 180px; height: 130px; background: white; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.content-image-preview img { width: 100%; height: 100%; object-fit: contain; }
.content-savebar { position: sticky; bottom: 0; z-index: 3; margin-top: 20px; padding: 16px; background: rgba(250, 247, 242, .96); border-top: 1px solid var(--line); }
.content-savebar .form-status { margin-bottom: 12px; }

@media (max-width: 800px) {
  .content-section { grid-template-columns: 1fr; }
  .content-fields { grid-template-columns: 1fr; }
  .content-image-field { grid-template-columns: 1fr; }
  .content-image-field .muted { grid-column: 1; margin: 0; }
  .content-image-preview { width: 100%; height: 190px; }
}
@media (max-width: 650px) {
  main { padding: 16px; }
  nav { gap: 14px; font-size: 14px; }
  .panel { padding: 17px; }
  h1 { font-size: 28px; }
  header { padding: 15px; }
  .toolbar form { width: 100%; }
}
