/* ============================================================
   About / Wikipedia Card
   ============================================================ */
.about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.about-overlay.hidden { display: none; }

.about-card {
  background: var(--modal-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.about-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--card-border);
}

.about-tabs {
  display: flex;
  gap: 0;
}

.about-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 18px 10px;
  transition: color .2s, border-color .2s;
}
.about-tab:hover { color: var(--text); }
.about-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.about-card-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 32px;
}

/* ---- Article view ---- */
.about-wiki {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.about-infobox {
  flex-shrink: 0;
  width: 210px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.82rem;
}

.about-article-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 14px;
}

.about-infobox-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.about-infobox-photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--text-muted);
}

.about-infobox-name {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
}

.about-infobox-table {
  width: 100%;
  border-collapse: collapse;
}
.about-infobox-table tr { border-bottom: 1px solid var(--card-border); }
.about-infobox-table tr:last-child { border-bottom: none; }
.about-infobox-table td {
  padding: 6px 10px;
  vertical-align: top;
  color: var(--text);
  line-height: 1.4;
}
.about-infobox-table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  width: 40%;
}

.about-infobox-links {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--card-border);
}
.about-infobox-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.about-infobox-links a:hover { text-decoration: underline; }

/* ---- Article text ---- */
.about-article {
  flex: 1;
  min-width: 0;
}

.about-article-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
}

.about-article-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  font-style: italic;
}

.about-article-opening {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.about-section {
  margin-bottom: 22px;
}

.about-section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 10px;
  color: var(--text);
}

.about-section p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 10px;
}

.about-era-block {
  margin-bottom: 14px;
}
.about-era-block h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.about-era-block .about-era-years {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.about-era-block p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

/* Works & Awards tables */
.about-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.about-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 2px solid var(--card-border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.about-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--text);
  vertical-align: top;
}
.about-table tr:last-child td { border-bottom: none; }
.about-table .about-td-year {
  white-space: nowrap;
  color: var(--text-muted);
  width: 60px;
}
.about-table .about-td-type {
  font-size: 0.78rem;
  color: var(--private-color);
  white-space: nowrap;
}

/* Empty state */
.about-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.about-empty svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: .35; display: block; margin-inline: auto; }
.about-empty p { font-size: 1rem; margin-bottom: 8px; }
.about-empty .about-empty-sub { font-size: 0.85rem; opacity: .6; }

/* ---- Edit form ---- */
.about-edit-form {}

.about-edit-section {
  margin-bottom: 28px;
}
.about-edit-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--card-border);
}
.about-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.about-edit-row.single { grid-template-columns: 1fr; }
.about-edit-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.about-edit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.about-edit-tag {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 10px 2px 8px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}
.about-edit-tag button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  opacity: .7;
}
.about-edit-tag button:hover { opacity: 1; }

/* Dynamic list items (eras, works, awards, links) */
.about-dyn-item {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}
.about-dyn-item-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  opacity: .6;
  line-height: 1;
  padding: 2px 4px;
}
.about-dyn-item-remove:hover { opacity: 1; }
.about-add-btn {
  background: none;
  border: 1px dashed var(--card-border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 100%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color .2s, color .2s;
}
.about-add-btn:hover { border-color: var(--accent); color: var(--accent); }

.about-save-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  position: sticky;
  bottom: 0;
  background: var(--modal-bg);
  padding-bottom: 4px;
}

@media (max-width: 600px) {
  .about-overlay { padding: 0; align-items: flex-end; }
  .about-card { max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .about-wiki { flex-direction: column; gap: 16px; }
  .about-infobox { width: 100%; }
  .about-edit-row { grid-template-columns: 1fr; }
  .about-card-body { padding: 16px 16px 24px; }
}

/* ---- Infobox caption ---- */
.about-infobox-caption {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 6px 10px 4px;
  line-height: 1.4;
  border-bottom: 1px solid var(--card-border);
}

/* ---- About photo upload (edit form) ---- */
.about-photo-upload-section {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 4px;
}
.about-photo-upload-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.about-photo-preview-wrap {
  flex-shrink: 0;
}
.about-photo-preview {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  border: 1px solid var(--card-border);
}
.about-photo-placeholder {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
}
.about-photo-placeholder svg {
  width: 32px;
  height: 32px;
}
.about-photo-upload-meta {
  flex: 1;
  min-width: 0;
}
#ae-dob {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block;
}
.about-edit-row > div {
  min-width: 0;
  overflow: hidden;
}

.ae-dob-age {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}
.ae-dob-age strong { color: var(--accent); }

.about-photo-caption-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

@media (max-width: 480px) {
  .about-photo-upload-row { flex-direction: column; }
  .about-photo-preview, .about-photo-placeholder { width: 80px; height: 80px; }
}

/* ---- Edit form inner tabs ---- */
.ae-tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ae-tab-bar::-webkit-scrollbar { display: none; }
.ae-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 8px 14px 10px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.ae-tab-btn:hover { color: var(--text); }
.ae-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.ae-tab-section { padding-top: 4px; }
.ae-tab-section.hidden { display: none; }

/* ---- Motion timeline edit UI ---- */

.mte-wrap { padding: 4px 0 8px; }

.mte-warning {
  background: var(--danger-dim);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.mte-current-field {
  margin-bottom: 16px;
}

.mte-tip {
  font-size: 0.77rem;
  color: var(--text-subtle);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.mte-timeline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Pin row */
.mte-pin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--card-border);
  position: relative;
}
.mte-pin-first { border-color: rgba(167,139,250,.3); }
.mte-pin-last  { border-color: rgba(247,37,133,.3); }

.mte-pin-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1; }

.mte-pin-body { flex: 1; min-width: 0; }
.mte-pin-city {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mte-pin-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.mte-pin-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-top: 2px;
}
.mte-pin-last .mte-pin-badge { color: var(--private-color); }

.mte-pin-remove {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.mte-pin-remove:hover { color: var(--danger); background: var(--danger-dim); }

/* Connector / add zone */
.mte-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  min-height: 32px;
  color: var(--text-subtle);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color .15s;
}
.mte-connector:hover { color: var(--accent); }
.mte-connector:hover .mte-line { background: var(--accent); opacity: .4; }
.mte-connector:hover .mte-add-hint { opacity: 1; }

.mte-line {
  flex: 1;
  height: 1px;
  background: var(--card-border);
  transition: background .15s;
}
.mte-add-hint {
  opacity: 0;
  white-space: nowrap;
  transition: opacity .15s;
  letter-spacing: 0.04em;
}
.mte-connector:hover .mte-add-hint { opacity: 1; }

/* Inline add form */
.mte-inline-form {
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(167,139,250,.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 2px 0;
}
.mte-inline-city-row { display: flex; }
.mte-inline-city-row .input { flex: 1; }

.mte-inline-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mte-season-pills {
  display: flex;
  gap: 4px;
}
.mte-season-pill {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.mte-season-pill:hover { border-color: var(--accent); color: var(--accent); }
.mte-season-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.mte-year-input {
  width: 80px !important;
  text-align: center;
}

.mte-inline-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* ---- Motion / Movement History article view ---- */

/* Timeline path */
.motion-path-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.motion-path {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-width: max-content;
  padding: 8px 0 4px;
}
.motion-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 90px;
  max-width: 110px;
  position: relative;
}
.motion-node-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--modal-bg);
  box-shadow: 0 0 0 2px var(--card-border);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.motion-node-dot-pulse {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px rgba(167,139,250,.25);
  animation: motion-pulse 2s ease-in-out infinite;
}
@keyframes motion-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px rgba(167,139,250,.2); }
  50%       { box-shadow: 0 0 0 2px var(--accent), 0 0 0 8px rgba(167,139,250,.05); }
}
.motion-node-city {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.2;
}
.motion-node-state {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.motion-node-dur {
  font-size: 0.7rem;
  color: var(--text-subtle);
  margin-top: 3px;
}
.motion-node-note {
  font-size: 0.68rem;
  color: var(--private-color);
  margin-top: 2px;
  font-style: italic;
}
.motion-current-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.motion-arrow {
  font-size: 1.3rem;
  color: var(--text-subtle);
  align-self: flex-start;
  margin-top: 3px;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
}

/* Stats row: pie + ranked */
.motion-stats-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Pie chart */
.motion-chart-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.motion-pie {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.motion-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}
.motion-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
}
.motion-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.motion-legend-name {
  flex: 1;
  color: var(--text);
}
.motion-legend-pct {
  font-weight: 700;
  color: var(--text);
  min-width: 32px;
  text-align: right;
}
.motion-legend-dur {
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 55px;
}

/* Ranked bar list */
.motion-ranked {
  flex: 1;
  min-width: 200px;
}
.motion-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.motion-rank-num {
  width: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}
.motion-rank-bar-wrap {
  flex: 1;
  min-width: 0;
}
.motion-rank-label {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.motion-rank-bar {
  height: 5px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.motion-rank-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.motion-rank-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.motion-rank-pct {
  font-size: 0.85rem;
  font-weight: 700;
}
.motion-rank-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .motion-stats-row { flex-direction: column; }
  .motion-chart-wrap { flex-direction: row; align-items: flex-start; }
  .motion-pie { width: 100px; height: 100px; }
}

/* ============================================================
