:root {
  --paper: #f4f1ea;
  --card: #ffffff;
  --ink: #1c1a17;
  --muted: #6b6455;
  --line: #e2dccf;
  --green: #0f5d4a;
  --green-dark: #0a4537;
  --gold: #c98a1b;
  --red: #b3372b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--green); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 640px; }

.top { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-right: 8px; }
.top a.link { font-size: 15px; font-weight: 600; text-decoration: none; }

h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 17px; margin: 0; max-width: 60ch; }
.hero { padding: 36px 0 22px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 8px 0 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.card:hover { border-color: var(--green); }
.cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0f5d4a, #17362f); object-fit: cover; width: 100%; }
.cover.empty { display: flex; align-items: flex-end; padding: 14px; color: #fff; font-weight: 700; font-size: 18px; line-height: 1.2; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.price { font-weight: 800; color: var(--green); font-size: 18px; }
.card .more { margin-top: auto; font-weight: 600; color: var(--green); font-size: 15px; }

.two { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 26px 0 56px; }
@media (min-width: 860px) { .two { grid-template-columns: 1.25fr .9fr; align-items: start; } .sticky { position: sticky; top: 78px; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.desc { white-space: pre-wrap; margin: 14px 0 0; }
.contents { list-style: none; margin: 0; padding: 0; }
.contents li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.contents li:first-child { border-top: 0; }
.contents small, .hint { color: var(--muted); font-size: 13px; }
.bigprice { font-size: 30px; font-weight: 800; color: var(--green); margin: 0 0 4px; }

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input, textarea, select {
  width: 100%; padding: 12px 13px; border: 1px solid #cfc8b8; border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; border: 0; border-radius: 10px;
  padding: 13px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--green-dark); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.block { width: 100%; margin-top: 18px; }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn.ghost:hover { background: #e9f1ee; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid #e3b8b2; }

.msg { border-radius: 10px; padding: 11px 13px; font-size: 15px; margin-top: 14px; }
.msg.err { background: #fbe9e6; color: #7c241b; }
.msg.ok { background: #e4f1ec; color: #0a4537; }
.msg.info { background: #fbf2de; color: #6a4a08; }
[hidden] { display: none !important; }

.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.files .name { font-weight: 600; word-break: break-word; }
.files .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; margin: 6px auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.center { text-align: center; }
.pad { padding: 34px 0 60px; }

footer { border-top: 1px solid var(--line); padding: 22px 0 34px; color: var(--muted); font-size: 14px; }

/* Admin */
.tabs { display: flex; gap: 8px; margin: 18px 0; }
.tabs button { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) { .row { grid-template-columns: 2fr 1fr; } }
.stack > * + * { margin-top: 16px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #e4f1ec; color: #0a4537; }
.tag.off { background: #eee9dd; color: var(--muted); }
.tag.wait { background: #fbf2de; color: #6a4a08; }
.tag.bad { background: #fbe9e6; color: #7c241b; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
progress { width: 100%; height: 8px; margin-top: 10px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 150px; }
.stat b { display: block; font-size: 24px; }
