/* Detail */

.detail-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}

.detail-tab {
  background: #f2f7fa;
  color: #274458;
  border: 1px solid #cddbe3;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  width: auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 0 1 auto;
}

.detail-tab.is-active {
  background: linear-gradient(180deg, var(--sea-700) 0%, var(--sea-800) 100%);
  color: #fff;
  border-color: transparent;
}

.detail-tab-panel {
  margin-top: 10px;
}

.detail-tab-panel h3 {
  margin: 0 0 14px;
  margin-top: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d7e4ec;
}

.detail-subtitle {
  margin: -4px 0 14px;
  color: #527083;
}

.detail-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.detail-heading-row .detail-top-actions,
.detail-heading-row .admin-naufragio-top-actions {
  flex: 0 0 auto;
  margin: 0;
  justify-content: flex-end;
}

.detail-heading-row .detail-top-actions .btn.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 36px;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 1;
}

.detail-report-error-form {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 0;
}

.detail-report-error-link {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5b7484;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.detail-report-error-link:hover,
.detail-report-error-link:focus-visible {
  background: transparent;
  color: var(--sea-800);
  box-shadow: none;
}

.report-error-modal-card {
  max-width: 620px;
}

.report-error-modal-form {
  display: grid;
  gap: 16px;
}

.report-error-field {
  display: grid;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  color: #173247;
}

.report-error-field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
  font-weight: 500;
}

.report-error-actions {
  justify-content: flex-end;
  margin-top: 2px;
}

.naufragio-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 6px;
}

.detail-title-line {
  flex: 0 1 auto;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  gap: 6px;
}

.admin-title-line {
  margin-bottom: 18px;
}

.naufragio-title-name {
  margin: 0;
  min-width: 0;
  line-height: 1.08;
}

.naufragio-title-eyebrow {
  display: block;
  margin: 0 0 4px;
  color: #527083;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.naufragio-title-chip {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 172px;
  padding: 4px 8px;
  border: 1px solid #ffffff;
  border-radius: 999px;
  background: #143145;
  color: #ffffff;
  font-size: 0.78rem;
  line-height: 1.15;
  white-space: nowrap;
}

.naufragio-title-chip strong {
  color: #ffffff;
  font-size: 0.84rem;
}

.detail-ancient-note {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: -4px 0 14px;
  padding: 8px 12px;
  border: 1px solid rgb(217 180 107 / 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(217 180 107 / 0.14), rgb(20 75 98 / 0.08));
  color: var(--sea-900);
  font-size: 0.92rem;
  font-weight: 700;
}

.detail-ancient-note[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .detail-heading-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .detail-heading-row .detail-top-actions,
  .detail-heading-row .admin-naufragio-top-actions {
    width: 100%;
    padding-top: 0;
    justify-content: flex-start;
  }

  .naufragio-title-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .naufragio-title-chip {
    width: 100%;
  }
}

.detail-hero-photo {
  margin: 0 0 16px;
  display: flex;
  justify-content: flex-start;
}

.detail-illustration-thumb {
  display: block;
  width: clamp(220px, 28vw, 320px);
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d5e3ec;
  border-radius: 12px;
  background: #f4f9fc;
  box-shadow: 0 8px 20px rgba(20, 52, 73, 0.12);
  cursor: zoom-in;
}

.detail-illustration-thumb:hover,
.detail-illustration-thumb:focus-visible {
  border-color: #7aa7bd;
  box-shadow: 0 10px 24px rgba(20, 52, 73, 0.18);
}

.detail-hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-link-preview {
  margin: 0 0 14px;
}

.detail-link-preview p {
  margin: 0 0 10px;
}

.detail-link-preview-panel {
  margin-top: 8px;
}

.detail-link-preview-panel summary {
  margin-bottom: 12px;
}

.detail-link-preview-thumb {
  width: 100%;
  max-width: 920px;
  aspect-ratio: 16 / 8.6;
  border: 1px solid #d5e3ec;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f9fc;
  box-shadow: 0 8px 20px rgba(20, 52, 73, 0.08);
}

.detail-link-preview-thumb iframe {
  display: block;
  width: 160%;
  height: 160%;
  border: 0;
  background: #fff;
  transform: scale(0.625);
  transform-origin: top left;
  pointer-events: none;
}

.detail-inline-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}

.detail-inline-grid--compact-below {
  margin-bottom: 6px;
}

.detail-inline-grid--tight-between {
  margin-bottom: 3px;
}

.detail-inline-grid--tight-top {
  margin-top: 6px;
}

.detail-inline-grid--ultra-tight {
  gap: 3px;
}

.detail-inline-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-inline-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-tight-following-field {
  margin-top: 6px;
}

.detail-compact-field {
  margin-bottom: 3px;
}

.detail-location-compact-stack {
  display: grid;
  row-gap: 3px;
}

.detail-location-compact-stack > p,
.detail-location-compact-stack .detail-inline-grid > p {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-basic-compact-stack {
  display: grid;
  row-gap: 14px;
}

.detail-basic-compact-stack > p,
.detail-basic-compact-stack > ul,
.detail-basic-compact-stack > .detail-link-preview {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-basic-compact-stack > .detail-inline-grid {
  margin: 0;
}

.detail-basic-compact-stack .detail-inline-grid > p,
.detail-basic-compact-stack .detail-inline-grid > div {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-basic-compact-stack .detail-inline-grid > div > p,
.detail-basic-compact-stack .detail-inline-grid > div > ul {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-basic-compact-stack .detail-inline-grid > div > ul {
  padding-left: 18px;
}

.detail-location-standard-stack {
  row-gap: 14px;
}

.detail-location-standard-stack > .detail-inline-grid,
.detail-location-standard-stack > p,
.detail-location-standard-stack > .detail-map-block,
.detail-location-standard-stack > .detail-text-field-group,
.detail-location-standard-stack > .detail-text-block,
.detail-location-standard-stack > .croqui,
.detail-location-standard-stack > .detail-location-compact-stack {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-location-standard-stack .detail-inline-grid > p,
.detail-location-standard-stack .detail-inline-grid > div,
.detail-location-standard-stack .detail-location-compact-stack > p,
.detail-location-standard-stack .detail-location-compact-stack .detail-inline-grid > p {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-naufragio-standard-stack > .detail-inline-grid,
.detail-naufragio-standard-stack > p,
.detail-naufragio-standard-stack > .detail-text-field-group,
.detail-naufragio-standard-stack > .detail-text-block,
.detail-naufragio-standard-stack > .croqui {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-naufragio-standard-stack .detail-inline-grid > p,
.detail-naufragio-standard-stack .detail-inline-grid > div {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-historicos-standard-stack > .detail-inline-grid,
.detail-historicos-standard-stack > p,
.detail-historicos-standard-stack > .detail-text-field-group,
.detail-historicos-standard-stack > .detail-text-block,
.detail-historicos-standard-stack > .croqui {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-historicos-standard-stack .detail-inline-grid > p,
.detail-historicos-standard-stack .detail-inline-grid > div {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-historical-separator {
  height: 1px;
  margin: 2px 0;
  background: linear-gradient(90deg, rgba(205, 219, 227, 0), #cddbe3 12%, #cddbe3 88%, rgba(205, 219, 227, 0));
}

.detail-tecnico-standard-stack > .detail-inline-grid,
.detail-tecnico-standard-stack > p,
.detail-tecnico-standard-stack > .detail-text-field-group,
.detail-tecnico-standard-stack > .detail-subsection {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-tecnico-standard-stack .detail-inline-grid > p,
.detail-tecnico-standard-stack .detail-inline-grid > div {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-tecnico-vessel-type {
  grid-column: span 2;
}

.detail-text-label-tight {
  margin-bottom: 4px;
}

.detail-text-block--tight-top {
  margin-top: 0;
}

.detail-map-frame--tight-top {
  margin-top: 0;
}

.detail-location-row-standard {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-row-card {
  padding: 12px 14px;
  border: 1px solid #d7e4ec;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: 0 6px 16px rgba(20, 52, 73, 0.06);
}

.detail-row-card > p,
.detail-row-card > div > p,
.detail-row-card > div > ul {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-text-block {
  margin: 6px 0 14px;
  padding: 10px 12px;
  border: 1px solid #d8e4eb;
  border-radius: 8px;
  background: #fbfdff;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.detail-inline-chip {
  margin-left: 8px;
  padding: 3px 8px;
  min-height: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.05;
  vertical-align: middle;
}

.detail-text-modal-card {
  position: fixed;
  top: 72px;
  left: max(16px, calc(50vw - 430px));
  width: min(860px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  pointer-events: auto;
}

.detail-text-modal-body {
  min-height: 180px;
}

.detail-inline-media-wrap {
  margin: 0 0 12px;
}

.detail-inline-reference-image {
  display: block;
  width: min(100%, 520px);
  max-height: 320px;
  object-fit: contain;
  border: 1px solid #d5e2e9;
  border-radius: 10px;
  background: #f8fbfd;
}

.detail-text-modal {
  background: transparent;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  pointer-events: none;
}

.detail-text-modal-header {
  cursor: move;
  user-select: none;
}

.pdf-export-modal-card {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
}

.pdf-export-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.pdf-export-tree {
  border: 1px solid #d8e5ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fcfe 0%, #f4f9fc 100%);
  padding: 14px;
  display: grid;
  gap: 12px;
  min-height: 0;
}

#pdf-export-tree {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  align-content: start;
  max-height: min(54vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.pdf-export-master-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d8e5ec;
  border-radius: 12px;
  background: #fff;
  color: #17384c;
  font-weight: 700;
}

.pdf-export-master-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1e617f;
  flex: 0 0 auto;
}

.pdf-tree-node {
  display: grid;
  gap: 8px;
}

.pdf-tree-node[data-level="0"] {
  padding: 14px;
  border: 1px solid #dbe7ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(18, 58, 82, 0.06);
  align-content: start;
}

.pdf-tree-children {
  display: grid;
  gap: 10px;
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.pdf-tree-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  color: #17384c;
  font-weight: 600;
  line-height: 1.35;
}

.pdf-tree-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1e617f;
  flex: 0 0 auto;
}

.pdf-tree-label--branch {
  font-size: 1rem;
  font-weight: 800;
  color: #143a52;
}

.pdf-tree-label--leaf {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e1ebf1;
  border-radius: 10px;
  background: #f9fcfe;
}

.pdf-tree-label--leaf input[type="checkbox"] {
  margin: 0;
  display: inline-block;
  flex: 0 0 18px;
  align-self: center;
}

.pdf-tree-label--leaf .pdf-tree-text {
  display: inline-block;
  flex: 1 1 auto;
  align-self: center;
}

.pdf-tree-text {
  display: block;
  min-width: 0;
}

.pdf-tree-node--root > .pdf-tree-children {
  grid-template-columns: 1fr;
}

.pdf-tree-node--root > .pdf-tree-children > .pdf-tree-node {
  gap: 8px;
}

.pdf-tree-node--root > .pdf-tree-children > .pdf-tree-node > .pdf-tree-label {
  margin-top: 2px;
  font-size: 0.94rem;
}

.pdf-tree-node--root > .pdf-tree-children > .pdf-tree-node > .pdf-tree-children {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #dbe7ee;
  margin-top: 16px;
  background: #fff;
}

.detail-panel-collapsible {
  margin: 0;
}

.detail-panel-collapsible summary {
  margin-bottom: 10px;
  font-weight: 700;
}

.detail-panel-collapsible[open] summary {
  margin-bottom: 12px;
}

.detail-panel-collapsible[open] > :not(summary) {
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 14px;
}

.detail-merge-history-list {
  display: grid;
  gap: 12px;
}

.detail-merge-history-item {
  padding: 14px 16px;
  border: 1px solid #d5e2e9;
  border-radius: 12px;
  background: #f8fbfd;
}

.detail-merge-history-item p {
  margin: 0 0 6px;
}

.detail-merge-history-item p:last-child {
  margin-bottom: 0;
}

.detail-merge-history-status {
  color: #2f6b53;
}

.detail-merge-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.detail-merge-history-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.detail-map-block {
  margin: 10px 0 14px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.detail-map-block--tight-top {
  margin-top: 0;
}

.detail-map-block--slightly-tight {
  margin-top: -4px;
}

.detail-field-label-tight {
  margin-bottom: 0;
}

.detail-text-field-group {
  display: grid;
  row-gap: 4px;
  margin: 0;
}

.detail-text-field-group > p,
.detail-text-field-group > .detail-text-block {
  margin: 0;
}

.detail-text-block--tight-top {
  margin: -2px 0 14px;
}

.detail-location-map-stack {
  display: grid;
  row-gap: 14px;
}

.detail-location-map-stack .detail-map-block {
  margin: 0;
}

.detail-location-map-stack > .detail-inline-grid {
  margin: 0;
}

.detail-location-map-stack .detail-map-block > .detail-field-label-tight {
  margin: 0 0 8px;
}

.detail-location-position-group > .detail-text-block--tight-top,
.detail-location-observacoes-group > .detail-text-block--tight-top {
  margin: 0;
}

.detail-location-position-group,
.detail-location-observacoes-group {
  row-gap: 8px;
}

.detail-location-coordinates-inline {
  margin: 0;
}

.detail-map-resizer {
  width: 100%;
  min-height: 354px;
  resize: vertical;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #d5e3ec;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5fbfe 0%, #e8f2f7 100%);
}

.detail-map-frame {
  position: relative;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  background: #f4f9fc;
}

.detail-map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
}

.detail-map-marker {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 3px 6px rgba(16, 48, 68, 0.22));
}

.detail-map-canvas .maplibregl-ctrl-top-left .maplibregl-ctrl-group {
  margin: 10px 0 0 10px;
  border: 1px solid #cfdde5;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 40, 56, 0.16);
  background: #fff;
}

.detail-map-canvas .maplibregl-ctrl-top-left .maplibregl-ctrl-group button {
  width: 30px;
  height: 30px;
  background: #fff;
  color: #29485c;
  border: 0;
}

.detail-map-canvas .maplibregl-ctrl-top-left .maplibregl-ctrl-group button + button {
  border-top: 1px solid #d7e4ec;
}

.detail-map-canvas .maplibregl-ctrl-top-left .maplibregl-ctrl-group button:hover {
  background: #f7fbfd;
}

.detail-map-resize-panel {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  border-top: 1px solid #d5e3ec;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(234, 243, 248, 0.94) 100%);
  color: #6a8799;
  font-size: 0.8rem;
  font-weight: 600;
}

.detail-map-resize-label {
  pointer-events: none;
  user-select: none;
}

.detail-map-resize-grip {
  width: 18px;
  height: 18px;
  pointer-events: none;
  user-select: none;
  background:
    linear-gradient(135deg, transparent 0 58%, #8ea6b5 58% 64%, transparent 64% 100%),
    linear-gradient(135deg, transparent 0 70%, #8ea6b5 70% 76%, transparent 76% 100%),
    linear-gradient(135deg, transparent 0 82%, #8ea6b5 82% 88%, transparent 88% 100%);
  opacity: 0.92;
}

.detail-map-overlay-button {
  position: absolute;
  left: 11px;
  top: 71px;
  z-index: 2;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #cfdde5;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 40, 56, 0.16);
  cursor: pointer;
}

.detail-map-overlay-button:hover {
  background: #f7fbfd;
}

.detail-map-center-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #111;
  border-radius: 999px;
}

.detail-map-center-icon::before,
.detail-map-center-icon::after {
  content: "";
  position: absolute;
  background: #111;
}

.detail-map-center-icon::before {
  left: 50%;
  top: -4px;
  width: 2px;
  height: 18px;
  transform: translateX(-50%);
}

.detail-map-center-icon::after {
  top: 50%;
  left: -4px;
  width: 18px;
  height: 2px;
  transform: translateY(-50%);
}

.detail-map-overlay-button:focus-visible {
  outline: 2px solid #5aa5c9;
  outline-offset: 2px;
}

.detail-admin-gallery-shell {
  display: grid;
  gap: 18px;
}

.detail-admin-gallery-section {
  display: grid;
  gap: 14px;
}

.detail-admin-gallery-upload {
  border-top: 1px solid #d5e2e9;
  padding-top: 14px;
}

.detail-admin-gallery-upload summary {
  cursor: pointer;
  font-weight: 700;
  color: #204b63;
}

.detail-admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.detail-admin-gallery-item {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d5e2e9;
  border-radius: 12px;
  background: #f8fbfd;
}

.detail-admin-gallery-item.is-reordered-highlight {
  animation: detail-media-reordered-flash 1.4s ease;
}

.detail-admin-gallery-meta {
  gap: 6px;
}

.detail-admin-gallery-meta strong {
  display: block;
}

.detail-admin-gallery-meta p {
  margin: 0;
}

.detail-admin-gallery-actions {
  display: grid;
  gap: 10px;
}

.detail-media-section-form,
.detail-media-section-form select,
.detail-media-transfer-form {
  width: 100%;
}

.detail-media-transfer-form {
  display: grid;
  gap: 8px;
}

.detail-media-transfer-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #204b63;
}

.detail-media-transfer-label span {
  font-size: 0.92rem;
}

.detail-media-transfer-input {
  width: 100%;
}

.detail-media-transfer-actions {
  display: flex;
  justify-content: flex-start;
}

.media-order-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #0f5577;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.media-badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e1f3e8;
  color: #235f46;
  font-size: 0.82rem;
  font-weight: 700;
}

.media-order-tools {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.media-order-arrow-btn {
  min-width: 40px;
}

.media-position-picker {
  margin: 0;
}

.media-position-picker summary {
  cursor: pointer;
  color: #204b63;
  font-weight: 700;
}

.media-position-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.media-position-btn {
  min-width: 40px;
  height: 34px;
  border: 1px solid #c5d7e1;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  color: #204b63;
  cursor: pointer;
}

.media-position-btn.is-current,
.media-position-btn:disabled {
  background: #dcecf5;
  color: #6a8594;
  cursor: default;
}

@keyframes detail-media-reordered-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(33, 122, 170, 0.45);
    border-color: #52a9cf;
  }
  100% {
    box-shadow: none;
    border-color: #d5e2e9;
  }
}

@media (max-width: 800px) {
  #pdf-export-tree {
    grid-template-columns: 1fr;
  }

  .pdf-tree-node--root > .pdf-tree-children > .pdf-tree-node > .pdf-tree-children {
    grid-template-columns: 1fr;
  }

  .detail-tabs { flex-wrap: wrap; }
  .pecas-transfer { grid-template-columns: 1fr; }
  .pecas-transfer-actions { flex-direction: row; }
}

@media (max-width: 640px) {
  .detail-inline-grid--2,
  .detail-inline-grid--3 {
    grid-template-columns: 1fr;
  }

  .detail-tecnico-vessel-type {
    grid-column: auto;
  }
}

.guided-story {
  display: grid;
  gap: 22px;
  width: min(1120px, calc(100vw - 32px));
  margin: 28px auto 48px;
}

.guided-story-hero,
.guided-story-card {
  border: 1px solid #d2e1e9;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(15, 52, 74, 0.1);
}

.guided-story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: 24px;
  align-items: stretch;
  padding: 26px;
  overflow: hidden;
}

.guided-story-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.guided-story-kicker {
  margin: 0;
  color: #2a7898;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.guided-story-hero h2,
.guided-story-section h3 {
  margin: 0;
  color: #143247;
}

.guided-story-hero h2 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.guided-story-subtitle {
  max-width: 62ch;
  margin: 0;
  color: #38586b;
  font-size: 1.08rem;
}

.guided-story-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.guided-story-hero__image {
  display: grid;
  align-content: end;
  margin: 0;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  background: #e8f3f8;
}

.guided-story-hero__image img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.guided-story-hero__image figcaption,
.guided-story-gallery figcaption {
  padding: 10px 12px;
  color: #38586b;
  font-size: 0.9rem;
}

.guided-story-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.guided-story-facts span {
  display: grid;
  gap: 5px;
  padding: 16px;
  background: linear-gradient(180deg, #f8fcfe, #eef7fb);
  color: #17364a;
}

.guided-story-facts strong {
  color: #5a7485;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guided-story-section {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.guided-story-section p {
  margin: 0;
  color: #24465a;
  line-height: 1.65;
}

.guided-story-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.guided-story-gallery figure {
  margin: 0;
  border: 1px solid #d2e1e9;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.guided-story-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.guided-story-documents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.guided-story-documents a {
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 0;
  border: 1px solid #d2e1e9;
  border-radius: 16px;
  background: #f8fcfe;
  color: #17364a;
  text-decoration: none;
}

.guided-story-document-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8f3f8;
}

.guided-story-document-card span {
  display: grid;
  gap: 4px;
  padding: 0 12px 12px;
}

.guided-story-document-card small {
  color: #5c7485;
}

.guided-story-documents a:hover,
.guided-story-documents a:focus-visible {
  border-color: #0f5577;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 85, 119, 0.13);
}

@media (max-width: 900px) {
  .guided-story-hero,
  .guided-story-facts {
    grid-template-columns: 1fr;
  }
}
