:root {
  --bg: #f4f6f8; --card: #fff; --ink: #1a2b3c; --muted: #64748b;
  --line: #e2e8f0; --accent: #0e7c61; --accent-dark: #0a5f4b;
  --danger: #dc2626; --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
header { background: linear-gradient(135deg, #0e7c61, #134e4a); color: #fff; padding: 18px 16px 12px; position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1100px; margin: 0 auto; }
h1 { margin: 0; font-size: 1.4rem; }
.subtitle { margin: 4px 0 0; opacity: .9; font-size: .92rem; }
.stats { max-width: 1100px; margin: 10px auto 2px; font-size: .85rem; opacity: .92; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: 390px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { main { grid-template-columns: 1fr; } header { position: static; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
h2 { margin: 0 0 12px; font-size: 1.1rem; }
form label { display: block; margin: 12px 0 0; font-weight: 600; font-size: .9rem; }
input[type="text"], input[type="search"], textarea, select { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-weight: 400; background: #fbfdff; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 6px; }
.hint-inline { color: var(--muted); font-weight: 400; font-size: .8em; }

/* multi-photo strip */
.photos-label { margin-top: 0; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.strip-empty { color: var(--muted); font-size: .85rem; font-weight: 400; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 10px; padding: 14px; width: 100%; text-align: center; }
.pthumb { position: relative; width: 148px; height: 148px; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: #0f172a; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.pthumb:hover { border-color: var(--accent); }
.pnum { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: .8rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.pbtn { position: absolute; top: 6px; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; width: 44px; height: 44px; cursor: pointer; font-size: 1.15rem; line-height: 1; background: rgba(255,255,255,.95); box-shadow: 0 1px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.pbtn.mark { right: 56px; }
.pbtn.del { right: 6px; color: var(--danger); }
@media (max-width: 600px) {
  .photo-strip { gap: 12px; }
  .pthumb { width: calc(50% - 6px); height: auto; aspect-ratio: 1 / 1; flex: 1 1 calc(50% - 6px); min-width: 150px; }
}
.add-photos-btn { margin-top: 10px; width: 100%; }

.suggest-wrap { border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; overflow: hidden; background: #fff; }
.suggest-wrap button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: #fff; cursor: pointer; font-size: .95rem; }
.suggest-wrap button:hover { background: #ecfdf5; }
.suggest-wrap small { color: var(--muted); margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #f1f5f9; border-radius: 999px; padding: 5px 11px; font-size: .82rem; cursor: pointer; font-weight: 400; }
.chip:hover { background: #dcfce7; border-color: var(--accent); }
.chip .count { color: var(--muted); }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; font-size: .92rem; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.secondary { background: #e2e8f0; color: var(--ink); }
.btn.small { padding: 6px 10px; font-size: .82rem; }
.btn.danger-ghost { background: transparent; color: var(--danger); border: 1px solid #fecaca; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.list-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.list-toolbar input { flex: 2; min-width: 200px; }
.list-toolbar select { flex: 1; min-width: 140px; }
.entry-list { display: grid; gap: 10px; }
.entry { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; align-items: center; background: #fff; }
.thumbstack { position: relative; flex-shrink: 0; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #e2e8f0; display: block; }
.morebadge { position: absolute; right: -6px; bottom: -6px; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 8px; padding: 1px 6px; }
.entry-body { flex: 1; min-width: 0; }
.entry-name { margin: 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-loc { margin: 2px 0; font-size: .85rem; color: var(--muted); }
.entry-loc strong { color: var(--accent-dark); }
.entry-actions { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 600px) {
  .entry-actions .btn { min-height: 44px; min-width: 76px; padding: 12px 16px; font-size: .9rem; }
  .add-photos-btn { padding: 14px; font-size: 1rem; }
}
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; padding: 18px; position: relative; }
.modal-card.wide { max-width: 720px; }
.modal-close { position: absolute; top: 10px; right: 10px; border: 0; background: #f1f5f9; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; }
.detail-loc { color: var(--accent-dark); font-weight: 600; margin: 0 0 10px; }
.detail-photos { display: grid; gap: 10px; }
.detail-photos img { width: 100%; border-radius: 10px; background: #0f172a; }
.editor-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.toolbtn.active { background: var(--accent); color: #fff; }
.swatches { display: inline-flex; gap: 6px; margin-left: 4px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.active { border-color: var(--ink); }
.editor-wrap { background: #0f172a; border-radius: 12px; overflow: auto; max-height: 55vh; display: flex; justify-content: center; touch-action: none; }
#editorCanvas { max-width: 100%; cursor: crosshair; touch-action: none; }
