:root {
  --navy: #0b2545;
  --blue: #1b8fd6;
  --ink: #1d2733;
  --muted: #5b6878;
  --line: #d9e1ea;
  --paper: #ffffff;
  --wash: #f4f7fa;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wash); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: var(--blue); }
h1, h2 { font-family: var(--serif); color: var(--navy); line-height: 1.2; font-weight: normal; }
h1 { font-size: 1.9rem; margin: 0 0 .35rem; }
h2 { font-size: 1.35rem; margin: 1.8rem 0 .5rem; }

.masthead { background: #fff; text-align: center; border-bottom: 1px solid var(--line); }
.masthead img { display: block; width: 100%; max-width: 1100px; height: auto; margin: 0 auto; }

.tabs { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; flex-wrap: wrap;
  background: var(--navy); }
.tabs a { color: #fff; text-decoration: none; padding: .8rem 1.1rem; font-size: .98rem; letter-spacing: .01em;
  border-bottom: 3px solid transparent; }
.tabs a:hover { background: rgba(255,255,255,.08); }
.tabs a.active { border-bottom-color: var(--blue); font-weight: 600; }

.demo { background: #fff4d6; color: #6b4e00; text-align: center; padding: .5rem 1rem; font-size: .92rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1.6rem 1.1rem 3rem; }
.panel[hidden] { display: none; }
.intro p, .lede { color: var(--muted); margin: 0 0 1.2rem; max-width: 46rem; }

.toolbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px;
  padding: .35rem .85rem; font: inherit; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
#search { flex: 0 1 260px; min-width: 180px; }

.status { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; }
.card .photo { aspect-ratio: 4 / 3; background: #e9eef3; display: block; width: 100%; border: 0; padding: 0; cursor: zoom-in; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .nophoto { aspect-ratio: 4 / 1; display: flex; align-items: center; justify-content: center;
  background: #eef3f8; color: #8a97a6; font-family: var(--serif); font-size: 1.05rem; }
.thumbs { display: flex; gap: 4px; padding: 4px 4px 0; }
.thumbs button { border: 0; padding: 0; width: 48px; height: 36px; cursor: pointer; background: #e9eef3; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card .cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); font-weight: 600; }
.card h3 { margin: 0; font-family: var(--serif); font-weight: normal; font-size: 1.2rem; color: var(--navy); line-height: 1.25; }
.card .price { font-weight: 700; color: var(--navy); }
.card .desc { margin: 0; color: var(--ink); font-size: .95rem; white-space: pre-line; }
.card .meta { color: var(--muted); font-size: .85rem; margin-top: auto; padding-top: .4rem; }
.card .btn { align-self: flex-start; margin-top: .5rem; }

.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 6px;
  padding: .65rem 1.2rem; font: inherit; font-size: .97rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #143a66; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn[disabled] { opacity: .6; cursor: wait; }
.cta { text-align: center; margin-top: 2rem; }

.form { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.3rem; max-width: 720px;
  display: flex; flex-direction: column; gap: .95rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; color: var(--navy); flex: 1; }
.form .row { display: flex; gap: .95rem; flex-wrap: wrap; }
.form .row > label { min-width: 200px; }
input, select, textarea { font: inherit; font-weight: normal; color: var(--ink); padding: .6rem .7rem;
  border: 1px solid #c3cfdb; border-radius: 6px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem 1rem; margin: 0; display: flex; flex-direction: column; gap: .95rem; }
legend { font-weight: 600; color: var(--navy); padding: 0 .3rem; }
.opt { font-weight: normal; color: var(--muted); font-size: .88rem; }
.note { color: var(--muted); font-size: .88rem; margin: 0; font-weight: normal; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: normal; color: var(--ink); }
.form label.check input { width: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form-msg { margin: 0; font-weight: 600; }
.form-msg.ok { color: #1f7a3a; }
.form-msg.err { color: #b3261e; }
.previews { display: flex; gap: .5rem; flex-wrap: wrap; }
.previews img { width: 110px; height: 82px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.charter { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--navy);
  border-left: 3px solid var(--blue); padding: .2rem 0 .2rem 1rem; max-width: 46rem; }
.rules li { margin-bottom: .45rem; }
#about p, #about ol { max-width: 46rem; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(11,37,69,.55); }
dialog .form { border: 0; max-width: none; }
dialog h2 { margin: 0; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; }
.photo-dialog { width: auto; max-width: 94vw; background: #000; text-align: center; padding: .5rem; }
.photo-dialog img { max-width: 90vw; max-height: 80vh; display: block; margin: 0 auto .5rem; }
.photo-dialog .btn { color: #fff; border-color: #666; }

footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .85rem; text-align: center; padding: 1.2rem 1rem 2rem; }
footer p { max-width: 46rem; margin: .3rem auto; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 1.55rem; }
  .tabs a { padding: .65rem .7rem; font-size: .9rem; }
  main { padding: 1.1rem .8rem 2.5rem; }
  #search { flex: 1 1 100%; }
  .form { padding: 1rem; }
}
.form > .btn { align-self: flex-start; }
