:root {
  color-scheme: light;
  --bg: #faf6ee;
  --surface: #fffdf8;
  --ink: #2b2118;
  --muted: #7a6a58;
  --line: #e7dcc8;
  --pine: #16624f;
  --pine-hi: #0f4a3c;
  --berry: #a31621;
  --berry-hi: #7f1021;
  --gold: #b8860b;
  --gold-soft: #f7ecd2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(#e9dfc9 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

h1, h2, .brand {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.01em;
}

.topbar {
  position: sticky;
  top: 0;
  background: rgba(250, 246, 238, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  color: var(--pine);
  text-decoration: none;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.brand svg { width: 1.2em; height: 1.2em; }

.topbar nav { display: flex; gap: 0.9rem; margin-left: auto; flex-wrap: wrap; }

.topbar nav a { font-size: 0.92rem; }

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

h1 { font-size: 1.45rem; margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
h3 { font-size: 0.95rem; margin: 0.8rem 0 0.35rem; color: var(--muted); }

a { color: var(--pine); }
a:hover { color: var(--pine-hi); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  margin: 0.7rem 0;
  box-shadow: 0 2px 10px rgba(120, 90, 40, 0.10);
}

.match {
  border-color: var(--gold);
  background: var(--gold-soft);
  font-size: 1.05rem;
}

form { display: grid; gap: 0.55rem; margin-top: 0.6rem; }

input, textarea, select {
  font: inherit;
  padding: 0.55rem 0.65rem;
  width: 100%;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--pine);
  outline-offset: 1px;
  border-color: var(--pine);
}

button {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  background: var(--berry);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

button:hover { background: var(--berry-hi); }

button.secondary {
  background: #f1e9d8;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.85rem;
  width: auto;
  justify-self: start;
  font-size: 0.88rem;
  font-weight: 600;
}

button.secondary:hover { background: #e7dcc4; }

form + form { margin-top: 0.4rem; }

.url-row { display: flex; gap: 0.5rem; }
.url-row input { flex: 1; min-width: 0; }
.url-row button { width: auto; white-space: nowrap; }

.form-row { display: flex; gap: 0.5rem; }
.form-row > * { flex: 1; min-width: 0; }

.thumb { display: block; max-width: 170px; max-height: 170px; object-fit: contain; border-radius: 8px; margin-bottom: 0.5rem; background: #fff; }

.thumb-side { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.thumb-side .grow { flex: 1; min-width: 0; }
.thumb-side .thumb { order: -1; margin-bottom: 0; flex-shrink: 0; }

@media (min-width: 700px) {
  .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  h1 { font-size: 1.6rem; }
  .thumb-side { flex-direction: row; }
  .thumb-side .thumb { order: 2; }
}
