/* Plain Sight design system — embed + spec surfaces (STU-32) */

:root {
  /* STU-35 — queue selection + destructive confirm */
  --ps-iron-soft: #ddd8cc;
  --ps-iron: #a23e2a;
  --m-quick: 180ms;
  --t-mono: 11px;
  --t-base: 1rem;
  --ps-font-ui: "DM Sans", "Inter", system-ui, sans-serif;
}

/* STU-79 — wordmark + text inputs (curator login + shared) */
.ps-wordmark {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--ps-ink, #0e0e0c);
  margin: 0;
  line-height: 1.2;
}

.input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--ps-rule, #dcd9c9);
  border-radius: 3px;
  background: #fff;
  color: var(--ps-ink, #0e0e0c);
}

.input:focus {
  outline: 2px solid var(--ps-accent, #22356f);
  outline-offset: 1px;
  border-color: var(--ps-accent, #22356f);
}

/* Canonical primary CTA (embed + map chrome — STU-55, STU-73) */
.btn-primary {
  background: var(--ps-iron);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: var(--ps-font-ui);
  font-size: var(--t-base);
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--ps-iron-hover, #8a3324);
  color: #fff;
}

.btn-use-location {
  width: 100%;
  min-height: 44px;
  font-family: var(--ps-font-sans);
  font-size: 14px;
  color: var(--ps-ink);
  background: transparent;
  border: 1px dashed var(--ps-paper-edge);
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-use-location:hover {
  border-color: var(--ps-stone);
  color: var(--ps-stone);
}

.placement-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px dashed var(--ps-period-1900, #c87820);
  box-sizing: border-box;
  flex-shrink: 0;
}

/* STU-103 — contribution direction cone on map */
.ps-direction-cone-marker {
  background: transparent;
  border: none;
}

.ps-direction-cone-root {
  position: relative;
  width: 160px;
  height: 160px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 200ms var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1));
}

.ps-direction-cone-root--enter {
  animation: ps-direction-cone-fade-in 200ms var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1));
}

@keyframes ps-direction-cone-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ps-direction-cone-root.ps-direction-cone--muted {
  opacity: 0.45;
  pointer-events: none;
}

.ps-direction-cone-svg {
  display: block;
  overflow: visible;
}

.ps-direction-cone-body {
  fill: var(--ps-iron, #a23e2a);
  fill-opacity: 0.18;
  stroke: var(--ps-iron, #a23e2a);
  stroke-width: 1.5;
  pointer-events: auto;
  cursor: grab;
}

.ps-direction-cone-wedge {
  transition: transform 150ms var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1));
}

.ps-direction-cone-root.ps-direction-cone--drag .ps-direction-cone-wedge {
  transition: none;
}

.ps-direction-cone-root.ps-direction-cone--snap .ps-direction-cone-wedge {
  transition: transform 150ms var(--ease-out, cubic-bezier(0.33, 1, 0.68, 1));
}

.ps-direction-cone-indicator {
  fill: var(--ps-iron, #a23e2a);
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}

.ps-direction-cone-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--ps-cone-bearing, 0deg)) translateY(-80px)
    rotate(var(--ps-cone-bearing-counter, 0deg));
  font-family: var(--ps-font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.2;
  background: var(--ps-paper-soft, #f6f3ec);
  border: 1px solid var(--ps-paper-edge, #ece5d6);
  border-radius: var(--r-pill, 999px);
  padding: 2px 8px;
  pointer-events: none;
  white-space: nowrap;
}

.ps-direction-cone-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%) rotate(var(--ps-cone-bearing, 0deg)) translateY(-80px);
  pointer-events: auto;
  cursor: grab;
  box-sizing: border-box;
}

.ps-direction-cone-handle::before {
  content: "";
  position: absolute;
  inset: -12px;
}

.ps-direction-cone-handle:focus-visible {
  outline: 2px solid var(--ps-iron, #a23e2a);
  outline-offset: 2px;
}

.ps-direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--ps-paper-edge, #ece5d6);
  background: var(--ps-paper-soft, #f6f3ec);
  font-family: var(--ps-font-mono, ui-monospace, monospace);
  font-size: 12px;
}

.ps-direction-compass-btn {
  margin-top: 0.5rem;
}

.spec-card {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--ps-rule, #dcd9c9);
}

.embed-card {
  border: 1px solid var(--ps-ink, #0e0e0c);
  background: var(--ps-paper, #f6f3ec);
  border-radius: 4px;
  padding: 0.65rem 0.75rem 0.85rem;
  box-shadow: 2px 3px 10px rgba(14, 14, 12, 0.12);
  max-width: 360px;
}

/* ---- STU-35 — destructive confirm (published photograph) ---- */

.destruct-card-root {
  position: fixed;
  inset: 0;
  z-index: 12500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.destruct-card-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 12, 0.45);
}

.destruct-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(92vh, 560px);
  overflow: auto;
  border: 1px solid var(--ps-ink, #0e0e0c);
  background: var(--ps-paper, #f6f3ec);
  box-shadow: 2px 5px 24px rgba(14, 14, 12, 0.28);
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.destruct-card-hd {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1.12rem;
  font-weight: 400;
  margin: 0;
  color: var(--ps-ink, #0e0e0c);
  line-height: 1.35;
}

.destruct-card-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ps-ink, #0e0e0c);
}

.destruct-card-body em {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
}

.destruct-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.destruct-card-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.destruct-btn-ghost {
  appearance: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: 3px;
  border: 1px dashed var(--ps-ink-muted, #5a5851);
  background: transparent;
  color: var(--ps-ink-muted, #5a5851);
  cursor: pointer;
  text-align: center;
}

.destruct-btn-ghost:hover {
  border-color: var(--ps-ink, #0e0e0c);
  color: var(--ps-ink, #0e0e0c);
}

.destruct-btn-secondary {
  appearance: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: 3px;
  border: 1px solid var(--ps-ink, #0e0e0c);
  background: rgba(255, 255, 255, 0.35);
  color: var(--ps-ink, #0e0e0c);
  cursor: pointer;
}

.destruct-btn-secondary:hover {
  border-color: var(--ps-accent, #22356f);
  color: var(--ps-accent, #22356f);
}

.destruct-btn-danger {
  appearance: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: 3px;
  border: 1px solid #8a2020;
  background: #8a2020;
  color: #fdf8ee;
  cursor: pointer;
}

.destruct-btn-danger:hover {
  background: #6f1818;
  border-color: #6f1818;
}

.destruct-permanent-panel {
  border-top: 1px dashed var(--ps-rule, #dcd9c9);
  padding-top: 0.65rem;
  margin-top: 0.15rem;
}

.destruct-permanent-panel[hidden],
.destruct-permanent-panel.hidden {
  display: none !important;
}

.destruct-confirm-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.destruct-confirm-label input {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--ps-rule, #dcd9c9);
}

/* ---- STU-48 — fixed bottom timeline strip + density histogram ---- */

:root {
  --ps-paper-edge: #ece5d6;
  --ps-timeline-strip-z: 850;
  --ps-font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  /* STU-84 — year-slider thumb morphology tokens */
  --r-lg: 10px;
  --r-xl: 14px;
  --r-pill: 999px;
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

.timeline-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--ps-paper, #f6f3ec);
  border-top: 1px solid var(--ps-paper-edge);
  display: flex;
  flex-direction: column;
  z-index: 900;
  overflow: visible;
  box-sizing: content-box;
}

.timeline-strip-inner {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.timeline-v2.timeline-v2--strip {
  width: 100%;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.timeline-v2--strip .timeline-row-1 {
  width: 100%;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.timeline-v2--strip .timeline-focus-year {
  font-family: var(--ps-font-mono, ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Menlo, monospace);
  font-size: 14px;
  color: var(--ps-ink, #0e0e0c);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition:
    color var(--m-base, 200ms) var(--ease-out),
    opacity var(--m-base, 200ms) var(--ease-out);
}

.timeline-v2--strip .timeline-strip-chips-wrap {
  flex: 0 0 auto;
}

.timeline-v2--strip .timeline-row-2 {
  width: 100%;
  height: 36px;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.timeline-v2--strip .window-chips {
  justify-content: flex-end;
}

.timeline-v2--strip .timeline-slider-shell {
  height: 36px;
  min-height: 36px;
  padding-inline: 12px;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

.timeline-v2--strip .timeline-slider-shell .timeline-track-bg {
  left: 12px;
  right: 12px;
  width: auto;
}

.timeline-v2--strip .timeline-slider-shell .timeline-track-bg {
  top: 17px;
  height: 2px;
  background: var(--ps-stone, #6d7070);
  opacity: 0.3;
  border-radius: 2px;
  transition: opacity var(--m-base, 200ms) var(--ease-out);
}

.timeline-v2--strip .timeline-slider-shell .timeline-track-bg.timeline-baseline--dimmed {
  opacity: 0.1;
}

.timeline-v2--strip .timeline-slider-shell .timeline-density.timeline-histogram {
  top: 0;
  bottom: 0;
  left: 12px;
  right: 12px;
  width: auto;
  height: 100%;
  transform: none;
  pointer-events: none;
}

.timeline-bar {
  position: absolute;
  bottom: 19px;
  width: 1px;
  margin-left: -0.5px;
  max-height: 16px;
  transform: translateX(-50%);
  transform-origin: bottom center;
  border-radius: 1px;
  background-color: var(--bar-color, #6d7070);
  pointer-events: auto;
  z-index: 1;
  touch-action: manipulation;
  transition: opacity var(--m-base, 200ms) var(--ease-out);
}

.timeline-strip[data-mode="all"] .timeline-bar {
  opacity: 0;
}

.timeline-strip[data-mode="all"] .timeline-focus-year {
  color: var(--ps-stone, #6d7070);
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle {
  position: absolute;
  top: 3px;
  height: 28px;
  transform: translateX(-50%);
  background: #ffffff;
  border: 2px solid var(--ps-ink, #1b2a3a);
  border-radius: var(--r-pill, 999px);
  box-shadow: 0 1px 4px rgba(27, 42, 58, 0.16);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width var(--m-base, 200ms) cubic-bezier(0.16, 1, 0.3, 1),
    opacity var(--m-base, 200ms) var(--ease-out);
  z-index: 2;
  outline: none;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.timeline-handle-halo,
.timeline-handle-ghost {
  display: none !important;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle:active {
  cursor: grabbing;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle[data-window="1yr"] {
  width: 28px;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle[data-window="1yr"]::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--ps-ink, #1b2a3a);
  border-radius: 50%;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle[data-window="5yr"]::after,
.timeline-v2--strip .timeline-slider-shell .timeline-handle[data-window="decade"]::after {
  display: none;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle[data-window="all"] {
  opacity: 0;
  pointer-events: none;
}

.timeline-v2--strip .timeline-slider-shell .timeline-handle:focus-visible {
  outline: 2px solid var(--ps-accent, #22356f);
  outline-offset: 2px;
}

.timeline-histogram-tooltip {
  position: fixed;
  z-index: 860;
  margin: 0;
  padding: 0.35rem 0.55rem;
  max-width: min(90vw, 280px);
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Menlo, monospace;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ps-ink, #0e0e0c);
  background: var(--ps-paper, #f6f3ec);
  border: 1px solid var(--ps-ink, #0e0e0c);
  outline: 1px solid var(--ps-ink, #0e0e0c);
  outline-offset: -4px;
  box-shadow: 2px 3px 12px rgba(14, 14, 12, 0.22);
  pointer-events: none;
}

.timeline-histogram-tooltip[hidden] {
  display: none !important;
}

@media (max-width: 719px) {
  .timeline-v2--strip .window-chips {
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.2rem;
    padding-bottom: 0.05rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--ps-paper-edge) transparent;
  }

  .timeline-v2--strip .window-chips::-webkit-scrollbar {
    height: 5px;
  }

  .timeline-v2--strip .window-chips::-webkit-scrollbar-track {
    background: transparent;
  }

  .timeline-v2--strip .window-chips::-webkit-scrollbar-thumb {
    background: var(--ps-paper-edge);
    border-radius: 3px;
  }
}
