:root {
  --bg: #0b1020;
  --panel: #111a33;
  --text: #e9ecf5;
  --muted: #a9b1c7;
  --accent: #6ea8fe;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #15204a 0%, var(--bg) 55%);
  color: var(--text);
}

a { color: inherit; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px;
  background: rgba(17, 26, 51, 0.7); backdrop-filter: blur(8px);
}
.brand { font-weight: 900; letter-spacing: .02em; font-size: 30px; }
.brand a { display: inline-flex; gap: 10px; align-items: baseline; }
.brandMain, .brandSub { white-space: nowrap; word-break: keep-all; }
.nav { display:flex; gap:10px; align-items:center; }
.pill {
  padding: 8px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); text-decoration: none;
}
.pill:hover { border-color: rgba(110,168,254,0.5); }

.panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 26, 51, 0.65);
  padding: 18px;
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 950px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px) {
  /* Only apply 3-col dense layout on public list page */
  body.public-list .container { padding: 14px; }
  body.public-list .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  body.public-list .card img { height: 120px; }
  body.public-list .placeholder { height: 120px; }
  body.public-list .card .body { padding: 10px; }
  body.public-list .card .title { font-size: 13px; }
  body.public-list .meta { font-size: 12px; gap: 6px; }
  body.public-list .tag { font-size: 11px; padding: 2px 6px; }
  .brand { font-size: 22px; }
  .brand a { flex-direction: column; align-items: flex-start; gap: 2px; }
  /* Hide header nav pills on mobile */
  .nav { display: none; }
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}
.card img { width: 100%; height: 180px; object-fit: cover; display:block; background:#0a0f22; }
.placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(27,42,90,0.55), rgba(42,61,122,0.25));
  color: rgba(233,236,245,0.85);
  font-weight: 800;
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.placeholder.small { height: 50px; border-bottom: none; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; }
.card .body { padding: 12px; }
.card .title { font-weight: 700; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 13px; display:flex; gap:10px; flex-wrap:wrap; }
.desc { color: #d9def0; font-size: 14px; line-height: 1.5; margin-top: 10px; }

form.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
}
input[type="checkbox"]{
  width: auto;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  vertical-align: middle;
}
input[type="file"]{
  padding: 8px 10px;
}
/* Improve readability of native select dropdown options (Windows etc.) */
select option {
  color: #111;
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-size: 13px; color: var(--muted); }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.btn {
  border: 1px solid rgba(110,168,254,0.5);
  background: rgba(110,168,254,0.18);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: rgba(110,168,254,0.26); }
.btn.secondary { border-color: var(--border); background: rgba(255,255,255,0.05); }
.btn.danger { border-color: rgba(255,107,107,0.55); background: rgba(255,107,107,0.12); }
.btn.danger:hover { background: rgba(255,107,107,0.2); }

/* Easy search modal (public list) */
.modal { position: fixed; inset: 0; display: none; z-index: 50; }
.modal.open { display: block; }
.modal .backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.modal .sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  background: rgba(17, 26, 51, 0.92);
  backdrop-filter: blur(10px);
  padding: 14px;
}
.sheetHeader { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.sheetSection { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(255,255,255,0.14); }
.sheetTitle { font-weight: 800; margin-bottom: 10px; }
.easySearchHeading { font-weight: 900; font-size: 18px; margin-bottom: 8px; }
.pillGrid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pillBtn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 12px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 24px;
}
.pillBtn:hover { border-color: rgba(110,168,254,0.55); background: rgba(110,168,254,0.14); }
.pillBtn.active { border-color: rgba(110,168,254,0.9); background: rgba(110,168,254,0.22); }
.sheetFooter { display:flex; gap:10px; justify-content:flex-end; margin-top: 14px; }

@media (max-width: 650px) {
  .modal .sheet {
    left: 50%;
    top: auto;
    bottom: 12px;
    transform: translate(-50%, 0);
    width: calc(100% - 24px);
    border-radius: 18px;
  }
  .pillGrid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .easySearchHeading { font-size: 20px; }
  .pillBtn { font-size: 15px; padding: 13px 10px; }
}

/* Admin form layout */
.form-panel { max-width: 760px; margin-left: auto; margin-right: auto; }
.form-heading { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.form-gap { height: 10px; }
.form-gap-lg { height: 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.add-detail-btn { margin-top: 8px; font-size: 13px; }
.detail-thumb {
  width: 80px; height: 60px; object-fit: cover; border-radius: 8px;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,0.12);
}

.error {
  border: 1px solid rgba(255,107,107,0.55);
  background: rgba(255,107,107,0.12);
  padding: 10px 12px;
  border-radius: 12px;
  margin-top: 12px;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align:left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.tag { display:inline-block; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); margin-right:6px; color: var(--muted); font-size:12px; }

.drag-cell { width: 32px; text-align: center; vertical-align: middle; }
.drag-handle {
  display: inline-block;
  cursor: grab;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 6px 4px;
  user-select: none;
}
.drag-handle:hover { color: var(--text); }
.table tr.dragging { opacity: 0.4; background: rgba(110,168,254,0.08); }

/* Detail image slots (admin form) */
.detail-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.detail-slot-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-slot-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.detail-slot textarea {
  min-height: auto;
}
.detail-remove {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
  cursor: pointer;
  margin-left: auto;
}

/* Detail images (public detail page) */
.detail-image-item { margin-top: 14px; }
.detail-image-caption {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

