.sights-board-header {
  padding: 1.25rem 1.5rem 0.75rem;
}

.back-link {
  font-size: 0.9rem;
  color: rgb(5, 39, 103);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.trip-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 auto 0.5rem;
  padding: 1.25rem;
  max-width: 60rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trip-detail-image {
  width: 14rem;
  height: 9rem;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.trip-detail-info {
  flex: 1;
  min-width: 12rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trip-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.trip-detail-titlerow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.trip-detail-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.trip-detail-text {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
  white-space: pre-wrap;
}

.btn-edit {
  width: 5rem;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-edit:hover {
  border-color: rgb(5, 39, 103);
  color: rgb(5, 39, 103);
}

.trip-detail-actions .btn-edit {
  width: auto;
  flex: 1 1 auto;
  text-align: center;
}

@media (max-width: 640.98px) {
  .trip-detail {
    flex-direction: column;
    padding: 1rem;
  }

  .trip-detail-image {
    width: 100%;
    height: 10rem;
  }
}

.sights-section-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 auto 1rem;
  padding: 0.85rem 1.25rem;
  max-width: 60rem;
  width: calc(100% - 2.5rem);
  background: white;
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  font-weight: 600;
  color: rgb(5, 39, 103);
  cursor: pointer;
  text-align: left;
}

.sights-section-toggle:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.sights-section-toggle-icon {
  display: inline-block;
  width: 1rem;
  transition: transform 0.15s;
}

.share-link-row {
  display: flex;
  gap: 0.5rem;
}

.share-link-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #555;
}

.share-muted {
  color: #888;
  font-size: 0.85rem;
  margin: 0;
}

.share-collaborator-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.share-collaborator-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.share-remove-btn {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.btn-edit-danger {
  color: #c0392b;
  border-color: #c0392b;
}

.btn-edit-danger:hover {
  background: #c0392b;
  color: white;
}

.btn-confirm-danger {
  background-image: none;
  background-color: #c0392b;
}

.kebab-menu-wrapper {
  position: relative;
  flex: 0 0 auto !important;
}

.trip-detail-actions .kebab-menu-trigger {
  width: 2.5rem;
  flex: 0 0 auto;
}

.kebab-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
}

.kebab-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 6;
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  min-width: 9rem;
  overflow: hidden;
}

.kebab-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
}

.kebab-menu-item:hover {
  background: #f2f2f2;
}

.kebab-menu-item-danger {
  color: #c0392b;
}

/* Sort-by-popularity dropdown above the sight cards (issue #49). Same width/centering as the
   section toggle above it, so the two read as one block. */
.sights-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 auto;
  max-width: 60rem;
  width: calc(100% - 2.5rem);
  font-size: 0.9rem;
}

.sights-sort-bar select {
  width: auto;
  max-width: 100%;
}

/* ── Notes & to-dos page (issues #50/#51) ──────────────────────────────────── */

.notes-page-title {
  margin: 0 auto 1rem;
  max-width: 70rem;
  width: calc(100% - 2.5rem);
  font-size: 1.6rem;
}

/* Two columns side by side on wide screens, stacked (notes first) on narrow ones. */
.notes-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 1.25rem;
  margin: 0 auto 2rem;
  max-width: 70rem;
  width: calc(100% - 2.5rem);
  align-items: start;
}

.notes-panel,
.todos-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 0;
}

.notes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notes-panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: rgb(5, 39, 103);
}

.notes-panel-empty {
  margin: 0;
  color: #6c7580;
  font-size: 0.9rem;
}

.note-card {
  padding: 0.75rem 0.9rem;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #fbfcfd;
}

.note-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.note-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.note-card-actions,
.todo-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Plain text, but keep the line breaks people typed. */
.note-card-text {
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  color: #343a40;
}

.note-card-meta {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: #6c7580;
}

.note-form-text {
  min-height: 10rem;
}

.todos-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: #6c7580;
  margin-left: 0.35rem;
}

.todos-hide-done {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #495057;
  cursor: pointer;
}

.todo-add-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.4rem;
}

@media (max-width: 640.98px) {
  .todo-add-form {
    grid-template-columns: 1fr 1fr;
  }

  .todo-add-text {
    grid-column: 1 / -1;
  }
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: white;
}

.todo-item-dragover {
  border-color: #2471a3;
  box-shadow: 0 0 0 2px rgba(36, 113, 163, 0.25);
}

.todo-drag-handle {
  color: #adb5bd;
  cursor: grab;
  user-select: none;
  letter-spacing: -0.15em;
}

.todo-check {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  cursor: pointer;
}

.todo-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.todo-text {
  overflow-wrap: anywhere;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #6c7580;
}

.todo-assignee {
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #e7f1f8;
  color: #1b4f72;
}

.todo-item-overdue .todo-due {
  color: #c0392b;
  font-weight: 600;
}

/* Done items stay where they are in the manual order, just visibly finished. */
.todo-item-done {
  background: #f8f9fa;
}

.todo-item-done .todo-text {
  text-decoration: line-through;
  color: #8a939c;
}

.todo-move-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: white;
  color: #495057;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.todo-move-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.todo-form-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

/* The app's .btn-confirm look is only defined inside dialog action rows (.trip-form-actions), so
   the page's own primary buttons get the same gradient explicitly. */
.notes-primary-btn {
  padding: 0.45rem 1.1rem;
  border: none;
  border-radius: 6px;
  background-image: linear-gradient(90deg, rgb(5, 39, 103) 0%, #3a0647 70%);
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.notes-primary-btn:hover {
  opacity: 0.9;
}

/* Issue #59: map section. Same width as the section toggles above it; the map itself is
   styled in tripMap.css. */
.sights-map {
  margin: 0 auto 1rem;
  max-width: 60rem;
  width: calc(100% - 2.5rem);
}

.sights-map-hint {
  margin: 0 auto 1rem;
  max-width: 60rem;
  width: calc(100% - 2.5rem);
  color: #6c7580;
  font-size: 0.9rem;
}

.sights-map-placing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 auto 0.75rem;
  max-width: 60rem;
  width: calc(100% - 2.5rem);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: #fff6d6;
  color: #5a4500;
  font-weight: 600;
}

.sights-map-placing-actions {
  display: flex;
  gap: 0.5rem;
}
