:root {
  --bg: #f7f5ef; --card: #ffffff; --ink: #23291f; --muted: #6b7363;
  --green: #2f6f4f; --green-dark: #245a40; --green-soft: #e5eee8;
  --line: #e3e0d6; --danger: #c2553b; --ochre: #a86a15; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--green); }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1040px; margin: 0 auto; padding: 18px 16px 6px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 60px; }

h2 { margin: 26px 0 4px; font-size: 22px; letter-spacing: -.01em; }
.sub { margin: 0 0 16px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: #cfcbbd; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--green-dark); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 0 10px; }
.btn.quiet:hover { color: var(--ink); }
.btn.wide { width: 100%; min-height: 52px; font-size: 17px; }

.notice {
  margin: 12px 0; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); font-size: 15px;
}
.notice.warn { border-color: #ecd9b0; background: #fbf4e3; }
.notice.bad { border-color: #ecc4b8; background: #fbece7; }

.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.post {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.post .img { position: relative; aspect-ratio: 4 / 5; background: var(--green-soft); }
.post .img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post .img .wait {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: rgba(247, 245, 239, .9); color: var(--muted); font-weight: 600;
}
.post .body { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 600; }
.tag.grey { background: #efede5; color: var(--muted); }
textarea {
  width: 100%; min-height: 190px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fcfbf8; resize: vertical; line-height: 1.45;
}
textarea:focus, input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.count { align-self: flex-end; margin-top: -6px; font-size: 12px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row .btn { flex: 1 1 auto; }
.hint { display: flex; gap: 8px; }
.hint input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf8; }
.err { color: var(--danger); font-size: 14px; }
.small { font-size: 14px; color: var(--muted); }
.done { padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-weight: 600; }

.empty { padding: 36px 18px; text-align: center; border: 1px dashed #cfcbbd; border-radius: 18px; color: var(--muted); }
.empty .btn { margin-top: 14px; }

.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.history a, .history div.h { display: block; text-decoration: none; color: inherit; }
.history img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.history .skipped img { opacity: .45; }
.history span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

.login { max-width: 360px; margin: 14vh auto 0; padding: 0 16px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.login input { min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; }
