/* Feuille de style dédiée — Écran des Rapports des Royaumes d'Aether
 * Liste gauche compacte sans barre latérale épaisse de sélection,
 * illustration peinte généreuse posée directement sur le parchemin sans cadre superflu,
 * registre sobre bois / bronze / parchemin.
 */

.report-filter-tabs {
  padding: 5px 6px 0;
  gap: 2px;
  flex-wrap: nowrap;
}

/* UI polish 2026-11-19: the list column is 18 to 38 px wider, so that the six tabs hold on one row. */
.realm-window[data-realm-window="reports"] .realm-window-body.is-split {
  grid-template-columns: minmax(318px, 338px) minmax(0, 1fr);
}

.report-filter-tabs .tab {
  padding: 4px 5px;
  font-size: 11.5px;
  gap: 4px;
  line-height: 1.2;
  white-space: nowrap;
}

.panel-scroll:has(> .report-list) {
  padding: 8px 10px;
}

.report-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.report-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  padding: 6px 9px;
  text-align: left;
  font-family: inherit;
  color: var(--ink-primary, #241c14);
  background: rgba(250, 244, 230, 0.56);
  border: 1px solid rgba(90, 66, 46, 0.22);
  border-radius: var(--radius-sm, 4px);
  cursor: var(--cur-pointer, pointer);
  transition: background-color 100ms ease, border-color 100ms ease;
}

.report-item.is-unread {
  background: rgba(254, 250, 240, 0.86);
  border-color: rgba(166, 126, 48, 0.45);
}

.report-item:hover {
  background: rgba(253, 249, 238, 0.88);
  border-color: rgba(138, 102, 46, 0.48);
}

.report-item:focus-visible {
  outline: 2px solid var(--focus-ring, #245c7a);
  outline-offset: 2px;
}

/* Sélection sobre par teinte parchemin chaud + filet bronze uniforme (aucune grosse bordure gauche) */
.report-item.is-selected,
.report-item[aria-current="true"] {
  background: linear-gradient(180deg, rgba(252, 245, 226, 0.96), rgba(235, 219, 184, 0.88));
  border-color: #a67e30;
  box-shadow: inset 0 1px 0 rgba(255, 251, 240, 0.78);
}

.report-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.report-item-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  vertical-align: 0;
  opacity: 0.9;
}

.report-item-title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-primary, #241c14);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-item.is-selected .report-item-title,
.report-item[aria-current="true"] .report-item-title {
  color: #1c140c;
}

.report-item-meta {
  display: block;
  padding-left: 21px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.25;
  color: var(--ink-muted, #74634f);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Panneau de lecture du rapport */
.report-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  color: var(--ink-primary, #241c14);
}

.report-sheet-illustrated {
  display: grid;
  grid-template-columns: minmax(180px, 264px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Illustration peinte généreuse directement sur parchemin, sans cadre ni boîte superflue */
.report-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.report-illustration-img {
  display: block;
  width: 100%;
  max-width: 264px;
  height: auto;
  max-height: clamp(168px, 30vh, 252px);
  object-fit: contain;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 6px 12px rgba(36, 24, 12, 0.2));
}

.report-illustration-svg,
.report-visual .live-wall-portrait {
  display: block;
  width: 100%;
  max-width: 248px;
  height: clamp(164px, 26vh, 224px);
  object-fit: contain;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 5px 10px rgba(36, 24, 12, 0.18));
}

.report-visual-unit .painted-unit {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
  max-height: clamp(150px, 26vh, 216px);
  object-fit: contain;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 5px 10px rgba(36, 24, 12, 0.2));
}

.report-editorial {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.report-lead {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-size: 15px;
  line-height: 1.48;
  color: var(--ink-primary, #241c14);
}

.report-role-block {
  margin: 0;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(166, 126, 48, 0.3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-sheet + .report-editorial { margin-top: 14px; }
.report-editorial .data-table caption { margin-bottom: 6px; text-align: left; font: 600 12px system-ui, -apple-system, sans-serif; color: var(--ink-secondary); }

.report-role-heading {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted, #74634f);
}

.report-role {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-secondary, #534434);
}

.report-ledger {
  margin: 2px 0 0;
  padding: 2px 0 0;
  border-top: 1px solid var(--border-hairline, rgba(58, 42, 26, 0.24));
  display: flex;
  flex-direction: column;
}

.report-ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(90, 66, 46, 0.22);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12.5px;
  line-height: 1.35;
}

.report-ledger-row dt {
  margin: 0;
  color: var(--ink-secondary, #534434);
  font-weight: 500;
}

.report-ledger-row dd {
  margin: 0;
  color: var(--ink-primary, #241c14);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-muted {
  color: var(--ink-muted, #74634f);
  font-weight: 400;
}

.report-current-state {
  color: var(--ink-secondary, #534434);
  font-weight: 600;
  font-size: 12px;
}

.report-cost-list {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.report-cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  background: rgba(214, 199, 168, 0.42);
  border: 1px solid rgba(90, 66, 46, 0.2);
  border-radius: 3px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary, #241c14);
  font-variant-numeric: tabular-nums;
}

.report-cost-chip .icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.report-warn {
  color: var(--accent-crimson, #9e3d32);
}

.report-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 1020px) {
  .report-sheet-illustrated {
    grid-template-columns: minmax(148px, 208px) minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 680px) {
  .report-sheet-illustrated {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .report-illustration-img {
    max-width: 210px;
    max-height: 172px;
  }

  .report-illustration-svg,
  .report-visual .live-wall-portrait {
    max-width: 200px;
    height: 152px;
  }

  .report-visual-unit .painted-unit {
    max-width: 172px;
    max-height: 156px;
  }
}

@media (max-height: 600px) {
  .report-sheet-illustrated {
    gap: 12px;
  }

  .report-illustration-img {
    max-height: 156px;
  }

  .report-illustration-svg,
  .report-visual .live-wall-portrait {
    height: 144px;
  }

  .report-editorial {
    gap: 7px;
  }

  .report-ledger-row {
    padding: 4px 0;
  }
}

/* Portraits peints & vignettes découpées runtime (Ministres, Compte, Quêtes, Commerce) */
.live-portrait-lead {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.live-portrait-lead > p {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.live-unit-portrait.live-portrait-frame {
  width: 76px;
  max-width: 76px;
  height: 76px;
  max-height: 76px;
  background: #e5dfd2;
  border: 1px solid rgba(108, 82, 52, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 250, 238, 0.55);
}

.live-unit-portrait.live-portrait-frame .painted-unit {
  object-fit: cover;
  object-position: 50% 15%;
}

.city-dock .live-unit-portrait.live-portrait-frame {
  width: 44px;
  max-width: 44px;
  height: 44px;
  max-height: 44px;
}

.live-portrait-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-convoy-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  min-width: 0;
}

.live-convoy-lead > p {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

img.live-convoy-art {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  background: none;
  border: 0;
  filter: drop-shadow(0 3px 6px rgba(36, 24, 12, 0.18));
}

.city-dock .live-convoy-lead {
  gap: 8px;
  margin-bottom: 6px;
}

.city-dock img.live-convoy-art {
  width: 42px;
  height: 42px;
}

.live-inline-media {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.live-alliance-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-alliance-summary > div { min-width: 0; }
.live-alliance-summary p { margin: 4px 0 0; }
.card.live-alliance-summary { flex-direction: row; }
.painted-emblem.live-alliance-emblem {
  display: block;
  flex: 0 0 64px;
  width: 64px;
  height: 72px;
  overflow: hidden;
}

.painted-emblem.live-emblem-small {
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 42px;
  overflow: hidden;
}

.live-palace-symbol {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  object-fit: contain;
}

img.live-convoy-thumb {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  background: none;
  border: 0;
  filter: drop-shadow(0 2px 4px rgba(36, 24, 12, 0.16));
}

.city-dock img.live-convoy-thumb {
  width: 22px;
  height: 22px;
}

.live-cutout-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

img.live-cutout-sm {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  background: none;
  border: 0;
  filter: drop-shadow(0 2px 5px rgba(36, 24, 12, 0.18));
}

@media (max-height: 600px) {
  .live-unit-portrait.live-portrait-frame {
    width: 60px;
    max-width: 60px;
    height: 60px;
    max-height: 60px;
  }

  img.live-convoy-art {
    width: 48px;
    height: 48px;
  }
}

/* Lot E3 — 14 filtres LoU, recherche X:Y, sélection multiple, rentabilité % et code de partage */
.report-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px 8px;
  border-bottom: 1px solid rgba(138, 102, 46, 0.28);
}

.report-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-select-all-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 4px;
  min-height: 26px;
  padding: 2px 7px 2px 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #4a3a26;
  background: rgba(255, 250, 238, 0.7);
  border: 1px solid rgba(138, 102, 46, 0.45);
  border-radius: 3px;
  cursor: var(--cur-pointer, pointer);
}

.report-select-all-label:has(input:disabled) {
  opacity: 0.55;
  cursor: var(--cur-unavailable, not-allowed);
}

.report-select-all-label input,
.report-select-box,
.report-lou-filter-chip input {
  margin: 0;
  accent-color: #a67e30;
  cursor: var(--cur-pointer, pointer);
}

.report-coords-input,
.report-shared-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 27px;
  padding: 3px 8px;
  font-size: 12px;
}

.report-lou-filters {
  border: 1px solid rgba(138, 102, 46, 0.32);
  border-radius: 4px;
  background: rgba(246, 237, 214, 0.62);
}

.report-lou-filters summary {
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary, #534434);
  cursor: var(--cur-pointer, pointer);
}

.report-lou-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  padding: 2px 8px 8px;
}

.report-lou-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-primary, #241c14);
  cursor: var(--cur-pointer, pointer);
  min-width: 0;
}

.report-lou-filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-shared-lookup {
  display: flex;
  align-items: center;
  gap: 5px;
}

.report-shared-error {
  margin: 0;
  font-size: 11.5px;
}

.report-item-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.report-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.report-nav-buttons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.report-share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(166, 126, 48, 0.36);
  border-radius: 4px;
  background: rgba(246, 237, 214, 0.56);
  font-size: 12px;
}

.report-share-code-wrap code {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(44, 30, 16, 0.1);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.report-modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(138, 102, 46, 0.36);
  background: rgba(235, 221, 190, 0.6);
  font-size: 12px;
}

.report-profitability {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 11px;
  border-radius: 4px;
  border: 1px solid rgba(138, 102, 46, 0.42);
  background: rgba(248, 240, 222, 0.78);
  font-variant-numeric: tabular-nums;
}

.report-profitability.is-positive {
  border-color: rgba(62, 128, 56, 0.55);
  background: rgba(226, 242, 218, 0.55);
}

.report-profitability.is-negative {
  border-color: rgba(168, 58, 48, 0.55);
  background: rgba(246, 222, 218, 0.55);
}

.report-profit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.report-profitability.is-positive .report-profit-head strong,
.report-profitability.is-positive .report-profit-rate {
  color: #266323;
}

.report-profitability.is-negative .report-profit-head strong,
.report-profitability.is-negative .report-profit-rate {
  color: #9e3026;
}

.report-profit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--ink-secondary, #534434);
}

.report-profit-losses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.report-troop-unit {
  display: flex;
  align-items: center;
  gap: 7px;
}

.report-troop-thumb {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(108, 82, 52, 0.36);
  background: #e5dfd2;
}

.report-troop-thumb .painted-unit {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
}
