:root {
  --bg: #f6f3ee;
  --ink: #1d2430;
  --muted: #5c6573;
  --card: #fffdf9;
  --line: #e4ddd3;
  --accent: #215e57;
  --accent-2: #173f3b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--accent); }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  flex-wrap: wrap;
}
.top nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--ink); text-decoration: none; }
.wrap { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.lead { font-size: 1.15rem; }
.muted { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  margin: 1rem 0;
}
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.narrow { max-width: 640px; }
label { display: block; margin: 0.9rem 0; font-weight: 600; }
input, textarea, select, button {
  font: inherit;
  width: 100%;
  margin-top: 0.35rem;
}
input, textarea, select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  width: auto;
  cursor: pointer;
}
.btn.secondary { background: var(--accent-2); }
.row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.inline { display: inline; width: auto; margin: 0; }
.inline button { width: auto; }
.linkish {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  width: auto;
}
.flash {
  background: #fff4d6;
  border: 1px solid #ead7a0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
}
.cards { display: grid; gap: 1rem; }
.choice {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
}
.choice span { display: block; color: var(--muted); }
.list { list-style: none; padding: 0; }
.hello { color: var(--muted); }
.usage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
}
.usage-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.filters { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1rem 0; }
.filters a { text-decoration: none; }
.filters .active { font-weight: 700; }
.checks { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; }
.check { font-weight: 500; }
.check input { width: auto; margin-right: 0.4rem; }
.plan-row { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; gap: 0.4rem; margin: 0.4rem 0; }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.overlay.hidden { display: none; }
.overlay-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.8rem;
}
.settings-nav { display: flex; gap: 1rem; margin: 0 0 1rem; }
.settings-nav a { text-decoration: none; }
.char-count { margin: 0; }
.char-count.over { color: #9b2c2c; }
.post-image-preview {
  display: block;
  width: auto;
  max-width: 100%;
  padding: 0;
  margin: 0 0 0.5rem;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.post-image {
  display: block;
  width: auto;
  max-width: min(100%, 320px);
  max-height: 180px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #efeae2;
}
.image-lightbox {
  flex-direction: column;
  padding: 1.5rem;
  background: rgba(29, 36, 48, 0.82);
}
.image-lightbox:not(.hidden) { display: flex; }
.image-lightbox img {
  max-width: min(96vw, 1200px);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}
.image-lightbox-close {
  width: auto;
  margin: 0 0 0.8rem;
  align-self: flex-end;
}
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.history-item { display: flex; gap: 0.8rem; align-items: center; }
@media (max-width: 640px) {
  .plan-row { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.55rem; }
  .wrap { padding: 1rem; }
}
