:root {
  font-family: 'Manrope', 'Poppins', system-ui, sans-serif;
  color: #1c1c1c;
  --accent: #0c8b8b;
  --surface: #ffffff;
  --muted: #5f6b77;
  --text: #1c1c1c;
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --hero-gradient: linear-gradient(135deg, #1c1c1c 0%, #333 100%);
  --card-shadow: 0 15px 30px rgba(31, 38, 68, 0.08);
}

.fas, .far { margin-right: 0.35em; }
.fas:only-child, .far:only-child { margin-right: 0; }
.meta-icon .fas,
.meta-icon .far,
.diary-card-icon .fas,
.diary-card-icon .far,
.empty-state-icon .fas,
.empty-state-icon .far,
.cover-ornament .fas,
.cover-ornament .far { margin-right: 0; }

* {
  box-sizing: border-box;
}

a {
  color: var(--accent);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f4fbff, #eef3f7 40%, #fefefe 100%);
  color: #1c1c1c;
}

.mb-1rem {
  margin-bottom: 1rem;
}


.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(28, 28, 28, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #0c8b8b;
  text-decoration: none;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
}

.lang-link {
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem !important;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}

.lang-link.active {
  background: var(--accent);
  color: #fff;
}

.app-bar--fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.app-bar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-bar__right {
  display: flex;
  align-items: center;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  transition: background 150ms;
}

.menu-toggle:hover {
  background: rgba(12, 139, 139, 0.1);
}

.action-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  transition: color 150ms, background 150ms;
}

.action-btn:hover {
  color: var(--accent);
  background: rgba(12, 139, 139, 0.1);
}

.side-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.side-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  z-index: 2000;
  background: var(--surface);
  transition: left 0.3s ease;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.side-menu.open {
  left: 0;
}

.side-menu__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(28, 28, 28, 0.08);
}

.side-menu__close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  color: var(--muted);
  border-radius: 0.5rem;
  transition: background 150ms;
}

.side-menu__close:hover {
  background: rgba(0,0,0,0.05);
}

.side-menu__nav {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1;
}

.side-menu__nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: #1c1c1c;
  font-size: 0.95rem;
  transition: background 150ms;
}

.side-menu__nav li a:hover {
  background: rgba(12, 139, 139, 0.08);
}

.side-menu__nav li a.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(12, 139, 139, 0.06);
}

.side-menu__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(28, 28, 28, 0.08);
}

.side-menu__footer a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #1c1c1c;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: color 150ms;
}

.side-menu__footer a:hover {
  color: var(--accent);
}

.side-menu__lang {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(28, 28, 28, 0.08);
}

.view {
  flex: 1;
  padding: 1.25rem;
  padding-top: 100px;
}

.app-footer {
  border-top: 1px solid rgba(28, 28, 28, 0.1);
  padding: 1rem;
  background: #edf8ff;
  margin-top: 2rem;
}

.app-footer__inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.app-footer__brand {
  font-weight: 600;
  color: var(--accent);
}

.app-footer__lang {
  display: flex;
  gap: 0.5rem;
}

.card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 15px 30px rgba(31, 38, 68, 0.08);
}

.toast-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 400px;
  z-index: 999;
}

.toast {
  background: #fff179;
  color: var(--accent);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-left: 3px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f05a";
  flex-shrink: 0;
}

form input,
form textarea,
form select {
  width: 100%;
  border: 1px solid rgba(28, 28, 28, 0.15);
  border-radius: 0.75rem;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fdfdfd;
  margin-bottom: 0.75rem;
}

form textarea {
    line-height: 1.8;
}

button,
.btn {
  border: none;
  border-radius: 0.85rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform 180ms ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(12, 139, 139, 0.15);
  color: var(--accent);
  font-size: 0.85rem;
}

.tag-pill-disabled {
  background: #e8ecf1;
  color: #5f6b77;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm:hover {
  text-decoration: none;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.media-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 150ms ease;
}

.media-grid img:hover {
  transform: scale(1.03);
}

.media-grid.media-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.35rem;
}

.media-grid.media-grid-sm img {
  border-radius: 0.35rem;
}

.media-preview {
  margin-bottom: 1.5rem;
}

.media-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.35rem;
}


.media-section {
  border: 1px solid rgba(12, 139, 139, 0.15);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: #fafbfc;
}

.media-picker {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.media-picker .btn {
  flex: 1;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.preview-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f0f0f0;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.preview-remove:hover {
  background: rgba(200,0,0,0.8);
}

.camera-mobile {
  display: none;
}

.media-thumb {
  position: relative;
  display: inline-block;
}

.media-thumb img {
  transition: opacity 150ms;
}

.media-thumb.marked img {
  opacity: 0.35;
}

.media-thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 150ms;
}

.media-thumb-del:hover {
  background: rgba(200,0,0,0.8);
}


.map-frame {
  width: 100%;
  min-height: 280px;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(12, 139, 139, 0.15);
}

.map-full {
  width: 100%;
  min-height: 0;
  border-radius: 0;
  border: none;
  margin: 0;
}

.book-view {
  perspective: 1500px;
  margin: 1rem auto;
  max-width: 520px;
  position: relative;
  min-height: 420px;
}

.book-page {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fdfdfd 0%, #f5f3ef 100%);
  border-radius: 2px 12px 12px 2px;
  padding: 1.5rem;
  box-shadow:
    -5px 5px 15px rgba(0, 0, 0, 0.08),
    inset 2px 0 5px rgba(0, 0, 0, 0.03);
  border-left: 3px solid #e8e0d4;
  transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  opacity: 0;
  transform: rotateY(-30deg);
  pointer-events: none;
  overflow-y: auto;
}

.book-page.active {
  opacity: 1;
  transform: rotateY(0deg);
  pointer-events: auto;
  z-index: 2;
}

.book-page.flipped {
  opacity: 0;
  transform: rotateY(-180deg);
}

.book-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, rgba(0,0,0,0.06), transparent);
  pointer-events: none;
}

.page-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #1c1c1c 0%, #333 100%);
  color: #fff;
  border-left-color: #555;
}

.page-cover::before {
  display: none;
}

.cover-ornament {
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0.5rem 0;
  letter-spacing: 0.5em;
}

.cover-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.75rem 0;
  line-height: 1.2;
}

.cover-subtitle {
  font-size: 0.95rem;
  opacity: 0.8;
  margin: 0.5rem 0;
}

.cover-date {
  font-size: 0.85rem;
  opacity: 0.5;
  margin-top: 1rem;
}

.page-back {
  background: linear-gradient(135deg, #1c1c1c 0%, #333 100%);
  color: #fff;
  border-left-color: #555;
}

.page-back::before {
  display: none;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.page-number {
  background: rgba(12, 139, 139, 0.1);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-weight: 600;
}

.page-location {
  font-style: italic;
}

.page-title {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
  color: #1c1c1c;
}

.page-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.page-body p {
  line-height: 1.7;
  font-size: 0.95rem;
  color: #2c2c2c;
  text-align: justify;
}

.page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0;
}

.page-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.4rem;
  margin-top: 1rem;
}

.page-media img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 0.35rem;
  cursor: pointer;
}

.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.book-nav-btn {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.6rem 1.2rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 150ms ease;
}

.book-nav-btn:hover {
  background: var(--accent);
  color: #fff;
}

.book-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.book-nav-btn:disabled:hover {
  background: var(--surface);
  color: var(--accent);
}

.book-counter {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.empty-message {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}



.suggestions {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(12, 139, 139, 0.35);
  background: #fff;
  max-height: 150px;
  overflow-y: auto;
  position: relative;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: none;
}

.suggestions li {
  padding: 0.35rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(12, 139, 139, 0.15);
}

.suggestions li:last-child {
  border-bottom: none;
}

.suggestions li:hover {
  background: rgba(12, 139, 139, 0.08);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(12, 139, 139, 0.15);
}

.form-actions button {
  flex: 1;
}

.btn-secondary {
  background: #e8ecf1;
  color: var(--muted);
}

.btn-secondary:hover {
  background: #dde3ea;
  transform: translateY(-1px);
}

.btn-primary-outline {
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: calc(0.85rem - 2px) calc(1.5rem - 2px);
  border-radius: 0.85rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 180ms ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.location-field {
  z-index: 20;
}


/* Collapsible sections (location, route) */
details summary {
  cursor: pointer;
  padding: 0.6rem 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "\f067";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 0.35rem;
  flex-shrink: 0;
}

details[open] > summary::before {
  content: "\f068";
}
details > :not(summary) {
  margin-left: 0.5rem;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 150ms;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  outline: none;
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms;
}

.lightbox-nav:hover,
.lightbox-nav:active {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%);
}

.lightbox-nav:active {
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-nav i {
  pointer-events: none;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  color: #fff;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100vh;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.route-section {
}

.route-map {
  width: 100%;
  min-height: 220px;
  border-radius: 0.75rem;
  border: 1px solid rgba(12, 139, 139, 0.2);
  margin-bottom: 1rem;
}

.route-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.route-row-label {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.route-row-label > span {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.25rem;
}

.route-row-label input {
  margin-bottom: 0;
}

.route-coords {
  display: none;
}

.route-coords input {
  width: 80px;
  margin-bottom: 0;
  opacity: 0.6;
  font-size: 0.8rem;
}

.link-fields {
  position: relative;
  background: #f9fafb;
  border: 1px solid rgba(12, 139, 139, 0.12);
  border-radius: 0.75rem;
  padding: 0.75rem;
  padding-right: 2.5rem;
  margin-bottom: 0.5rem;
}

.link-fields input {
  margin-bottom: 0.35rem;
  width: 96%;
}

.link-fields input:last-of-type {
  margin-bottom: 0;
}

.link-fields .btn-remove-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.add-btn {
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-remove {
  background: #e74c3c;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
}

.btn-remove:hover {
  background: #c0392b;
  text-decoration: none;
}

.btn-remove-icon {
  background: transparent;
  color: #e74c3c;
  padding: 0.75rem;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-icon:hover {
  background: #e74c3c;
  color: #fff;
  text-decoration: none;
}

.delete-form {
  margin: 0;
}

.route-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(12, 139, 139, 0.35);
  background: #fff;
  max-height: 140px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.route-suggestions li {
  padding: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(12, 139, 139, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-suggestions li:last-child {
  border-bottom: none;
}

.route-suggestions li:hover {
  background: rgba(12, 139, 139, 0.08);
}


/* Entry detail */
.entry-detail {
  max-width: 720px;
  margin: 0 auto;
}

.entry-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.entry-detail-back {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms;
}

.entry-detail-back:hover {
  color: var(--accent);
}

.book-container {
  max-width: 720px;
  margin: 0 auto;
}

.book-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.book-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}

.entry-detail-actions {
  display: flex;
  gap: 0.5rem;
}

.entry-detail-card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 15px 30px rgba(31, 38, 68, 0.08);
}

.entry-title {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  line-height: 1.3;
  color: #1c1c1c;
}

.entry-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.entry-media-section {
  margin-top: 1.5rem;
}

.entry-hero {
  background: #5f6b77;
  color: #fff;
  padding: 1.5rem;
}

.entry-hero-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.entry-meta-item {
  font-size: 0.85rem;
  opacity: 0.85;
}

.meta-icon {
  margin-right: 0.25rem;
}

.entry-hero-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem;
}

.entry-hero-media img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
}

.entry-body {
}

.entry-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #2c2c2c;
  margin-bottom: 1.5rem;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.entry-route-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.entry-route-map {
  width: 100%;
  min-height: 200px;
  border-radius: 0.75rem;
  border: 1px solid rgba(12, 139, 139, 0.2);
  margin-bottom: 1rem;
}

.route-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.route-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.route-step:last-child {
  border-bottom: none;
}

.route-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.route-step-name {
  font-size: 0.9rem;
  color: #2c2c2c;
}

.entry-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
}

.entry-nav-btn {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  text-decoration: none;
  background: var(--surface);
  color: var(--accent);
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(31, 38, 68, 0.08);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.entry-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 38, 68, 0.12);
}


.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.entry-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Diary detail */
.diary-detail {
  max-width: 720px;
  margin: 0 auto;
}

.diary-detail-back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 150ms;
}

.diary-detail-back:hover {
  color: var(--accent);
}

.diary-hero {
  background: linear-gradient(135deg, #1c1c1c 0%, #333 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.25rem;
  box-shadow: 0 15px 30px rgba(31, 38, 68, 0.12);
}

.diary-hero-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.diary-hero-desc {
  opacity: 0.8;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.diary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.diary-meta-item {
  font-size: 0.85rem;
  opacity: 0.75;
}

.diary-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.diary-action-btn {
  padding: 0.6rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid rgba(12, 139, 139, 0.2);
  transition: all 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.diary-action-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.diary-action-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.diary-action-btn.icon-only {
  padding: 0.65rem 0.75rem;
}

.diary-action-btn.primary:hover {
  background: #0a7575;
}

.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid rgba(28,28,28,0.1);
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  padding: 0.35rem;
  margin-top: 0.25rem;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-menu a,
.dropdown-menu form button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 150ms ease;
}

.dropdown-menu a:hover,
.dropdown-menu form button:hover {
  background: rgba(12,139,139,0.08);
  color: var(--accent);
}

.dropdown-menu form {
  margin: 0;
}

.dropdown-divider {
  height: 1px;
  background: rgba(28,28,28,0.08);
  margin: 0.25rem 0;
}

/* Timeline */
.entry-timeline {
  position: relative;
  padding-left: 0.5rem;
}

.timeline-entry {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 1.5rem;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 3px var(--accent);
  z-index: 1;
  flex-shrink: 0;
}

.timeline-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--accent), rgba(12, 139, 139, 0.15));
  margin-top: 4px;
}

.timeline-content {
  background: var(--surface);
  border-radius: 0.85rem;
  padding: 1rem;
  box-shadow: 0 5px 15px rgba(31, 38, 68, 0.06);
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}

.timeline-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(31, 38, 68, 0.1);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.entry-owner-badge {
  font-weight: 400;
  margin-left: 0.75rem;
}
.entry-owner-badge .fas {
  font-size: 0.7rem;
  margin-right: 0.2rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.05rem;
  margin: 0;
  color: #1c1c1c;
}

.timeline-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.timeline-preview {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #2c2c2c;
  margin: 0 0 0.75rem;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.timeline-actions .btn {
  text-decoration: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 15px 30px rgba(31, 38, 68, 0.08);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}


/* Dashboard */
.dashboard-page {
  max-width: 720px;
  margin: 0 auto;
}

.search-bar {
  margin-bottom: 3rem;
}

.search-bar input {
  margin-bottom: 0;
  background: var(--surface);
  box-shadow: 0 5px 15px rgba(31, 38, 68, 0.06);
  border: 1px solid rgba(12, 139, 139, 0.2);
}

.diary-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(12, 139, 139, 0.1);
}

.diary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.diary-card {
  background: var(--surface);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 5px 15px rgba(31, 38, 68, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 150ms ease, box-shadow 150ms ease;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.125rem 0.75rem;
  align-items: start;
}

.diary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(31, 38, 68, 0.12);
  text-decoration: none;
}

.diary-card-icon {
  font-size: 1.8rem;
  grid-row: 1 / 4;
  align-self: start;
  line-height: 1;
}

.diary-card-title {
  font-size: 1rem;
  margin: 0;
  color: #1c1c1c;
  grid-column: 2;
  grid-row: 1;
}

.diary-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
  grid-column: 2;
  grid-row: 2;
}


.diary-card-entries {
  font-size: 0.75rem;
  color: var(--muted);
}





@media (max-width: 600px) {
  :root {
    font-size: 17px;
  }
  .camera-mobile {
    display: inline;
  }
.media-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.4rem;
  }

  .media-grid.media-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  .diary-grid {
    grid-template-columns: 1fr;
  }

  .toast-row {
    padding: 0.5rem 1.25rem;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    transform: none;
  }
}
