/* Modals */
.tj-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tj-modal.is-open { display: flex; }
.tj-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(6px);
}
.tj-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: var(--tj-radius);
  border: 1px solid var(--tj-border);
  background: var(--tj-surface);
  box-shadow: var(--tj-shadow);
  animation: tj-modal-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (max-width: 640px) {
  .tj-modal {
    padding: 0.5rem;
    align-items: flex-end;
  }
  .tj-modal__dialog {
    width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 16px 16px 12px 12px;
    padding: 1.1rem 1rem 1.25rem;
  }
}
.tj-modal__dialog--wide { width: min(960px, 100%); }
.tj-modal__dialog--nested {
  width: min(560px, 100%);
  z-index: 2;
}
.tj-modal--nested { z-index: 220; }
@keyframes tj-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.tj-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tj-modal__head h2 {
  margin: 0;
  font-family: var(--tj-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.tj-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--tj-border);
  background: transparent;
  color: var(--tj-ink);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
.tj-modal__close:hover { background: var(--tj-accent-soft); }
.tj-lang-switch {
  border: 1px solid var(--tj-border);
  background: var(--tj-bg-elevated);
  color: var(--tj-ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.tj-lang-switch:hover { background: var(--tj-accent-soft); }
body.tj-modal-open { overflow: hidden; }

.tj-dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
}
.tj-dash-toolbar .tj-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}
.tj-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}
.tj-photo-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--tj-border);
  background: var(--tj-bg-elevated);
}
.tj-photo-upload {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.tj-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tj-photo-thumbs figure {
  position: relative;
  margin: 0;
  width: 88px;
}
.tj-photo-thumbs img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--tj-border);
}
.tj-photo-thumbs button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #c0392b;
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}
.tj-cube.is-clickable { cursor: pointer; }
.tj-cube.is-clickable:hover { outline: 2px solid var(--tj-accent); }
.tj-journey__detail-desc {
  white-space: pre-wrap;
  line-height: 1.55;
  max-height: none;
}
.tj-admin-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
