:root {
  --family-bg: #090b0d;
  --family-panel: #111418;
  --family-panel-strong: #171b20;
  --family-line: rgba(255, 255, 255, 0.11);
  --family-line-gold: rgba(244, 182, 63, 0.38);
  --family-text: #fff8eb;
  --family-muted: #a7adb5;
  --family-gold: #f4b63f;
  --family-gold-soft: #ffcf6e;
  --family-green: #57d29a;
  --family-red: #f06b73;
  --family-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.family-hub,
.family-album,
.family-album-detail,
.family-admin,
.miki-map-shell {
  color: var(--family-text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.family-hub,
.family-album,
.family-album-detail {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 76px;
}

.family-hub.is-embedded {
  width: min(1280px, 100%);
  margin-inline: auto;
  padding: 0 0 24px;
}

.family-hub .button,
.family-album .button,
.family-admin .button,
.family-admin button {
  min-height: 42px;
  border: 1px solid var(--family-gold) !important;
  border-radius: 10px;
  background: var(--family-gold) !important;
  color: #191305 !important;
  padding: 10px 16px;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.family-hub .button.secondary,
.family-album .button.secondary,
.family-admin .button.secondary,
.family-admin button.secondary {
  border-color: var(--family-line) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: var(--family-text) !important;
}

.family-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 430px;
  display: grid;
  align-content: end;
  gap: 22px;
  padding: clamp(26px, 5vw, 68px);
  border: 1px solid var(--family-line-gold);
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 18%, rgba(244, 182, 63, 0.24), transparent 30%),
    linear-gradient(120deg, rgba(8, 10, 12, 0.98), rgba(17, 20, 23, 0.9)),
    url("/static/miki-og-2026.png") center/cover;
  box-shadow: var(--family-shadow);
}

.family-hero::after {
  content: "MIKI";
  position: absolute;
  z-index: -1;
  right: -0.04em;
  bottom: -0.24em;
  color: rgba(255, 255, 255, 0.035);
  font-size: clamp(130px, 25vw, 360px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.09em;
}

.family-hero__brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.family-hero__brand > img {
  width: clamp(80px, 11vw, 138px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 15px 28px rgba(0, 0, 0, 0.48));
}

.family-hero__brand span,
.family-section > header span,
.family-album > header span,
.family-album-detail > header span,
.family-admin > header span {
  color: var(--family-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.family-hero h1 {
  margin: 5px 0 4px;
  color: #fff;
  font-size: clamp(35px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.family-hero h1 small {
  color: var(--family-gold-soft);
  font-size: 0.36em;
  letter-spacing: 0;
}

.family-hero__brand p,
.family-hero__intro {
  margin: 0;
  color: #e2e0da !important;
}

.family-hero__brand p {
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 760;
}

.family-hero__intro {
  max-width: 760px;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.58;
}

.family-hero__actions,
.family-album > header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.family-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 0;
  overflow: hidden;
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: var(--family-line);
}

.family-source-note {
  margin: 10px 0 0;
  color: var(--family-muted) !important;
  font-size: 12px;
  text-align: right;
}

.family-stat-grid article {
  min-width: 0;
  padding: 18px;
  background: var(--family-panel);
}

.family-stat-grid span,
.family-asset-card span,
.family-member-card > span {
  display: block;
  color: var(--family-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.family-stat-grid b {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: clamp(17px, 2vw, 27px);
  text-overflow: ellipsis;
}

.family-local-nav {
  position: relative;
  top: auto;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin: 28px 0;
  padding: 9px;
  overflow-x: auto;
  border: 1px solid var(--family-line);
  border-radius: 13px;
  background: rgba(10, 12, 14, 0.9);
  backdrop-filter: blur(18px);
}

.family-local-nav a {
  flex: 0 0 auto;
  border-radius: 8px;
  color: #d8dce2;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.family-local-nav a:hover,
.family-local-nav a:focus-visible {
  background: rgba(244, 182, 63, 0.12);
  color: var(--family-gold-soft);
}

.family-story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  scroll-margin-top: 164px;
}

.family-story-card {
  min-height: 270px;
  padding: 26px;
  border-top: 2px solid var(--family-gold);
  background: linear-gradient(180deg, var(--family-panel-strong), var(--family-panel));
}

.family-story-card > span {
  color: rgba(244, 182, 63, 0.48);
  font-size: 46px;
  font-weight: 950;
}

.family-story-card h2 {
  margin: 14px 0 12px !important;
  color: var(--family-text) !important;
  font-size: 25px;
}

.family-story-card p,
.family-section > header p,
.family-admin > header p,
.family-album > header p,
.family-album-copy p {
  color: var(--family-muted) !important;
  line-height: 1.62;
}

.family-section {
  padding: 80px 0 0;
  scroll-margin-top: 72px;
}

.family-section > header,
.family-album > header,
.family-admin > header {
  max-width: 820px;
  margin-bottom: 28px;
}

.family-section > header h2,
.family-album > header h1,
.family-album-detail > header h1,
.family-admin > header h2 {
  margin: 6px 0 8px;
  color: #fff;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

html[data-theme="light"] .family-section > header h2,
html[data-theme="light"] .family-album > header h1,
html[data-theme="light"] .family-album-detail > header h1 {
  color: #1c1914;
}

html[data-theme="light"] .family-section > header p,
html[data-theme="light"] .family-album > header p,
html[data-theme="light"] .family-album-detail > header p,
html[data-theme="light"] .family-album-copy p {
  color: #625d55 !important;
}

html[data-theme="light"] .family-section > header span,
html[data-theme="light"] .family-album > header span,
html[data-theme="light"] .family-album-detail > header span {
  color: #8a5e08;
}

.family-member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.family-member-card {
  overflow: hidden;
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: var(--family-panel);
  padding-bottom: 20px;
}

.family-member-card > div {
  height: 210px;
  margin-bottom: 19px;
  overflow: hidden;
  background: #0b0d0f;
}

.family-member-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.family-member-card > span,
.family-member-card h3,
.family-member-card p {
  margin-right: 20px;
  margin-left: 20px;
}

.family-member-card h3 {
  margin-top: 7px;
  margin-bottom: 2px;
  font-size: 21px;
}

.family-member-card p {
  margin-top: 0;
  color: var(--family-muted) !important;
}

.family-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.family-asset-grid.is-transport {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.family-asset-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 220px auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: var(--family-panel);
}

.family-asset-card[hidden] {
  display: none !important;
}

.family-asset-card.is-vehicle {
  grid-template-columns: 1fr;
  grid-template-rows: 190px auto;
}

.family-asset-card.is-vehicle > img,
.family-asset-card.is-property > img {
  object-fit: contain;
  padding: 12px;
}

.family-asset-card > .family-asset-gallery {
  height: 190px;
  position: relative;
  display: block;
  overflow: hidden;
  background: #080a0c;
  padding: 0;
  isolation: isolate;
}

.family-asset-gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  cursor: zoom-in;
}

.family-asset-gallery img.is-active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.family-admin .family-asset-gallery img {
  cursor: default;
}

.family-admin .family-asset-gallery-arrow,
.family-admin .family-asset-gallery-dots {
  display: none !important;
}

body.miki-page-public .family-asset-gallery-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 30px !important;
  height: 42px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: rgba(4, 6, 8, 0.28) !important;
  color: rgba(255, 255, 255, 0.58) !important;
  opacity: 0.22;
  transform: translateY(-50%);
  transition: opacity 160ms ease, background-color 160ms ease;
  cursor: pointer;
}

.family-asset-gallery-arrow span {
  font: 400 27px/1 system-ui, sans-serif;
  transform: translateY(-1px);
}

.family-asset-gallery-arrow.is-prev { left: clamp(8px, calc(50% - 162px), 45%); }
.family-asset-gallery-arrow.is-next { right: clamp(8px, calc(50% - 162px), 45%); }

.family-asset-gallery:hover .family-asset-gallery-arrow,
.family-asset-gallery:focus-within .family-asset-gallery-arrow,
.family-asset-gallery-arrow:focus-visible {
  opacity: 0.78;
  background: rgba(4, 6, 8, 0.62) !important;
}

.family-asset-gallery-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 8px;
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(4, 6, 8, 0.38);
  transform: translateX(-50%);
}

body.miki-page-public .family-asset-gallery-dots button {
  width: 5px !important;
  height: 5px !important;
  min-width: 0;
  min-height: 0 !important;
  display: block !important;
  flex: 0 0 auto;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.38) !important;
}

body.miki-page-public .family-asset-gallery-dots button.is-active {
  width: 14px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

@media (hover: none) {
  .family-asset-gallery-arrow { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .family-asset-gallery img,
  .family-asset-gallery-arrow { transition: none; }
}

.family-asset-card > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0d0f;
}

.family-asset-card > div {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 22px;
}

.family-asset-card h3,
.family-asset-card p {
  margin: 0;
}

.family-asset-card p {
  color: var(--family-muted) !important;
}

.family-asset-card b {
  color: var(--family-gold-soft);
  font-size: 19px;
}

.family-asset-card small {
  color: var(--family-muted);
}

.family-asset-source {
  display: block;
  line-height: 1.35;
}

.family-asset-metrics {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.family-asset-metrics li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--family-line);
  padding-top: 7px;
  color: var(--family-muted);
  font-size: 12px;
}

.family-asset-metrics li b {
  color: var(--family-text);
  font-size: 12px;
  text-align: right;
}

.family-asset-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: var(--family-panel);
  padding: 14px;
}

.family-asset-tools label {
  display: grid;
  gap: 6px;
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 800;
}

.family-asset-tools input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--family-line);
  border-radius: 9px;
  outline: none;
  background: #15191e;
  color: white;
  padding: 9px 12px;
  font: inherit;
}

.family-asset-tools input:focus {
  border-color: var(--family-gold);
  box-shadow: 0 0 0 3px rgba(244, 182, 63, 0.12);
}

.family-asset-tools > small {
  grid-column: 1 / -1;
  color: var(--family-muted);
}

.family-rank-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.family-rank-card {
  margin: 0;
  border: 1px solid var(--family-line);
  background: var(--family-panel);
}

.family-rank-card summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 12px 16px;
  cursor: pointer;
}

.family-rank-card summary b {
  width: 30px;
  color: var(--family-gold);
  font-size: 18px;
}

.family-rank-card summary span {
  min-width: 0;
  flex: 1;
  font-weight: 850;
}

.family-rank-card summary small {
  color: var(--family-muted);
  font-size: 10px;
}

.family-rank-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--family-line);
}

.family-rank-card li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--family-line);
  padding: 9px 16px;
  color: #d9dde2;
  font-size: 13px;
}

.family-rank-card li:last-child {
  border-bottom: 0;
}

.family-rank-card li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--family-green);
  box-shadow: 0 0 0 4px rgba(87, 210, 154, 0.1);
}

.family-empty {
  grid-column: 1 / -1;
  color: var(--family-muted);
  padding: 26px;
  border: 1px dashed var(--family-line);
}

.family-album > header {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 20px 0 16px;
  padding: 28px;
  border: 1px solid var(--family-line);
  border-radius: 18px;
  background: rgba(17, 20, 24, 0.94);
  box-shadow: var(--family-shadow);
}

.family-album > header > div:first-child {
  max-width: 770px;
}

.family-album-count {
  display: inline-flex;
  margin-left: 10px;
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 800;
}

.family-album > header .button.secondary {
  border-color: var(--family-line) !important;
  background: #171b20 !important;
  color: #fff !important;
}

html[data-theme="light"] .family-album > header {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 64px rgba(57, 45, 26, 0.12);
}

.family-album-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.family-album-grid.is-single {
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
}

.family-album-grid.is-single .family-album-card:first-child {
  grid-column: auto;
  width: 100%;
}

.family-album-card {
  grid-column: span 4;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--family-line);
  border-radius: 15px;
  background: var(--family-panel);
}

.family-album-card:first-child {
  grid-column: span 8;
}

.family-album-card > a {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(230px, 1fr) auto;
  color: inherit;
  text-decoration: none;
}

.family-album-card img,
.family-album-card video {
  width: 100%;
  height: 100%;
  max-height: 430px;
  object-fit: cover;
  background: #08090b;
}

.family-album-card > a > div {
  padding: 22px;
  background: var(--family-panel);
}

.family-album-card span,
.family-album-detail > header span {
  color: var(--family-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.family-album-card h2 {
  margin: 8px 0;
  color: var(--family-text) !important;
  font-size: 24px;
}

.family-album-card p,
.family-album-card small {
  color: var(--family-muted) !important;
}

.family-album-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.family-album-card footer b {
  color: var(--family-gold-soft);
  font-size: 13px;
}

.family-album-card > a:focus-visible {
  outline: 3px solid var(--family-gold);
  outline-offset: -3px;
}

.family-album-detail {
  max-width: 1120px;
  margin-top: 20px;
  padding: 30px;
  border: 1px solid var(--family-line);
  border-radius: 18px;
  background: rgba(17, 20, 24, 0.94);
  box-shadow: var(--family-shadow);
}

.family-back {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--family-gold-soft);
  font-weight: 800;
  text-decoration: none;
}

.family-album-detail > header {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--family-line);
}

.family-album-detail > header small {
  color: var(--family-muted);
}

.family-album-copy {
  max-width: 780px;
  margin: 32px 0;
  font-size: 17px;
}

html[data-theme="light"] .family-album-detail {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 64px rgba(57, 45, 26, 0.12);
}

html[data-theme="light"] .family-back {
  color: #7a4e00;
}

html[data-theme="light"] .family-album-detail > header small,
html[data-theme="light"] .family-album-detail .family-empty {
  color: #625d55 !important;
}

.family-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.family-media-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--family-line);
  background: var(--family-panel);
}

.family-media-grid img,
.family-media-grid video {
  display: block;
  width: 100%;
  max-height: 700px;
  object-fit: contain;
  background: #050607;
}

.family-media-grid img[data-album-image] {
  cursor: zoom-in;
}

.family-media-grid figcaption {
  min-height: 44px;
  color: var(--family-muted);
  padding: 12px 14px;
}

.family-lightbox {
  width: min(90vw, 1280px);
  height: min(88vh, 820px);
  max-width: none;
  max-height: none;
  margin: auto;
  border: 1px solid var(--family-line-gold);
  border-radius: 12px;
  background: rgba(5, 6, 7, 0.98);
  color: #fff;
  padding: 10px;
  overflow: hidden;
}

.family-lightbox:not([open]) {
  display: none !important;
  pointer-events: none !important;
}

.family-lightbox[open] {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) 24px;
  gap: 8px;
}

.family-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.family-lightbox__topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.family-lightbox__counter {
  padding-left: 8px;
  color: var(--family-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.family-lightbox__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #020304;
}

.family-lightbox__stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

body.miki-page-public .family-lightbox__close {
  float: none;
  width: auto !important;
  min-width: 92px !important;
  min-height: 34px !important;
  margin: 0;
  padding: 6px 14px !important;
  border: 1px solid var(--family-line);
  border-radius: 8px;
  background: #15181d;
  color: white;
  cursor: pointer;
}

body.miki-page-public .family-lightbox__arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 38px !important;
  height: 58px !important;
  min-width: 38px !important;
  min-height: 58px !important;
  display: grid !important;
  place-items: center;
  margin: 0 !important;
  padding: 0 0 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px !important;
  background: rgba(4, 6, 8, 0.46) !important;
  color: #fff !important;
  font: 400 34px/1 system-ui, sans-serif !important;
  opacity: 0.32;
  transform: translateY(-50%);
  transition: opacity 160ms ease, background-color 160ms ease;
  cursor: pointer;
}

.family-lightbox__arrow.is-prev { left: 12px; }
.family-lightbox__arrow.is-next { right: 12px; }

.family-lightbox__stage:hover .family-lightbox__arrow,
.family-lightbox__arrow:focus-visible {
  opacity: 0.88;
  background: rgba(4, 6, 8, 0.72) !important;
}

.family-lightbox__dots {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow-x: auto;
}

body.miki-page-public .family-lightbox__dots button {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
  min-height: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.34) !important;
  cursor: pointer;
}

body.miki-page-public .family-lightbox__dots button.is-active {
  width: 18px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

@media (hover: none) {
  body.miki-page-public .family-lightbox__arrow { opacity: 0.58; }
}

@media (max-width: 640px) {
  .family-lightbox {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    padding: 7px;
  }
  .family-lightbox[open] {
    grid-template-rows: 38px minmax(0, 1fr) 22px;
    gap: 5px;
  }
  body.miki-page-public .family-lightbox__arrow {
    width: 34px !important;
    height: 52px !important;
    min-width: 34px !important;
    min-height: 52px !important;
    font-size: 30px !important;
  }
  .family-lightbox__arrow.is-prev { left: 7px; }
  .family-lightbox__arrow.is-next { right: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .family-lightbox__arrow { transition: none; }
}

.miki-map-page {
  overflow: hidden !important;
}

.miki-map-shell {
  position: fixed;
  z-index: 2147482000;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #171717;
}

.miki-map-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #171717;
}

/* The legacy shell globally limits every canvas to max-width:100%. Leaflet's
   canvas lives in a zero-width pane, so the inherited rule must not reach it. */
.miki-map-shell .leaflet-pane > canvas {
  max-width: none !important;
}

.miki-map-toolbar {
  position: absolute;
  z-index: 1001;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  pointer-events: none;
}

.miki-map-toolbar__main,
.miki-map-toolbar__view {
  display: flex;
  align-items: stretch;
  gap: 10px;
  pointer-events: auto;
}

.miki-map-shell .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.miki-map-brand,
.miki-map-search,
.miki-map-draw,
.miki-map-filter-toggle,
.miki-map-layers,
.miki-map-zoom {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(22, 23, 24, 0.96);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.miki-map-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 144px;
  color: #f6f7f8;
  padding: 8px 12px;
  text-decoration: none;
}

.miki-map-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.miki-map-brand b {
  font-size: 15px;
}

.miki-map-search {
  display: flex;
  width: min(300px, 27vw);
  padding: 0 13px;
}

.miki-map-search input,
.miki-map-filter-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f7f7f7;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.miki-map-search input::placeholder,
.miki-map-filter-search input::placeholder {
  color: #85898e;
}

.miki-map-draw,
.miki-map-filter-toggle,
.miki-map-layers button,
.miki-map-zoom button,
.miki-map-panel button,
.miki-map-category {
  border: 0 !important;
  background: transparent !important;
  color: #d1d4d8 !important;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

body.miki-map-page .miki-map-draw,
body.miki-map-page .miki-map-filter-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(22, 23, 24, 0.96) !important;
  color: #d1d4d8 !important;
}

.miki-map-draw:hover,
.miki-map-filter-toggle:hover,
.miki-map-draw.is-active,
.miki-map-filter-toggle[aria-expanded="true"] {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.miki-map-layers,
.miki-map-zoom {
  display: flex;
  overflow: hidden;
}

.miki-map-layers button {
  min-width: 96px;
}

.miki-map-layers button + button,
.miki-map-zoom button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.miki-map-layers button.is-active {
  background: var(--family-gold) !important;
  color: #191305 !important;
}

.miki-map-zoom button {
  width: 46px;
  padding: 0;
  font-size: 23px;
  line-height: 1;
}

.miki-map-panel {
  position: absolute;
  z-index: 1002;
  top: 68px;
  left: min(602px, calc(100vw - 348px));
  width: min(336px, calc(100vw - 24px));
  max-height: min(660px, calc(100dvh - 84px));
  display: grid;
  grid-template-rows: auto auto auto minmax(80px, 1fr) auto auto;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(19, 20, 21, 0.97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  padding: 14px;
  backdrop-filter: blur(18px);
}

.miki-map-panel[hidden] {
  display: none !important;
}

.miki-map-panel > header,
.miki-map-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.miki-map-panel > header span {
  color: var(--family-gold);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.miki-map-panel > header h1 {
  margin: 2px 0 0;
  font-size: 18px;
}

.miki-map-panel > header button,
.miki-map-filter-head button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 7px;
  padding: 0 9px;
  color: var(--family-gold-soft) !important;
}

.miki-map-filter-search {
  display: flex;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #0f1113;
  padding: 0 11px;
}

.miki-map-filter-head {
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 800;
}

.miki-map-categories {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 3px;
}

.miki-map-category {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035) !important;
  padding: 7px 10px;
  text-align: left;
}

body.miki-map-page .miki-map-category[hidden] {
  display: none !important;
}

.miki-map-category i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--marker-color, var(--family-gold));
}

.miki-map-category em {
  color: var(--family-muted);
  font-style: normal;
}

.miki-map-category[aria-pressed="false"] {
  opacity: 0.48;
}

.miki-map-status {
  margin: 0;
  color: var(--family-muted);
  font-size: 12px;
}

.miki-map-panel > footer {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  border-top: 1px solid var(--family-line);
  padding-top: 11px;
}

.miki-map-panel > footer a {
  color: var(--family-gold-soft);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.miki-map-wordmark {
  position: absolute;
  z-index: 900;
  right: 20px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 30px;
  font-style: italic;
  pointer-events: none;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.72);
}

.miki-map-wordmark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.miki-map-wordmark span {
  color: var(--family-gold);
  font-weight: 950;
}

.miki-map-marker-icon {
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.miki-map-marker-dot,
.miki-map-draft-marker {
  background: transparent;
  border: 0;
}

.miki-map-marker-dot i {
  display: block;
  width: 10px;
  height: 10px;
  margin: 2px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--marker-color, var(--family-gold));
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.72);
}

.miki-map-draft-marker i {
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--family-gold);
  box-shadow: 0 0 0 4px rgba(244, 182, 63, 0.35);
}

.miki-map-shell.is-drawing .leaflet-container {
  cursor: crosshair;
}

.miki-map-popup {
  min-width: 190px;
  color: #11151a;
}

.miki-map-popup b,
.miki-map-popup small,
.miki-map-popup p {
  display: block;
}

.miki-map-popup small {
  color: #6a7079;
  margin: 4px 0;
}

.miki-map-popup p {
  margin: 7px 0 0;
}

.miki-map-popup img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  margin-top: 8px;
}

.miki-map-property-details {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(17, 21, 26, 0.12);
}

.miki-map-property-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.miki-map-property-details dt {
  color: #6a7079;
}

.miki-map-property-details dd {
  margin: 0;
  font-weight: 750;
  text-align: right;
}


/* Legacy site bundles still contain broad !important button rules. Keep the
   self-contained family and map surfaces readable in both theme modes. */
body:not(.miki-farm-page) .family-hub .button,
body:not(.miki-farm-page) .family-album .button,
body:not(.miki-farm-page) .family-admin .button,
body:not(.miki-farm-page) .family-admin button {
  border-color: var(--family-gold) !important;
  background: var(--family-gold) !important;
  color: #191305 !important;
}

body:not(.miki-farm-page) .family-hub .button.secondary,
body:not(.miki-farm-page) .family-album .button.secondary,
body:not(.miki-farm-page) .family-admin .button.secondary,
body:not(.miki-farm-page) .family-admin button.secondary {
  border-color: var(--family-line) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: var(--family-text) !important;
}

body:not(.miki-farm-page) .family-album > header .button.secondary {
  border-color: var(--family-line) !important;
  background: #171b20 !important;
  color: #fff !important;
}

/* Family public density v25 — same compact rhythm as the shared public shell. */
body.miki-page-public .family-hub,
body.miki-page-public .family-album,
body.miki-page-public .family-album-detail {
  width: min(1180px, calc(100% - 32px));
  padding: 24px 0 58px;
}

body.miki-page-public .family-hero {
  min-height: 270px;
  gap: 14px;
  padding: 30px;
  border-radius: 14px;
}

body.miki-page-public .family-hero__brand {
  gap: 14px;
}

body.miki-page-public .family-hero__brand > img {
  width: 82px;
}

body.miki-page-public .family-hero h1 {
  font-size: clamp(38px, 4vw, 48px);
  line-height: 1;
}

body.miki-page-public .family-hero__brand p,
body.miki-page-public .family-hero__intro {
  font-size: 15px;
  line-height: 1.5;
}

body.miki-page-public .family-hub .button,
body.miki-page-public .family-album .button {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 12px;
}

body.miki-page-public .family-stat-grid article {
  padding: 12px;
}

body.miki-page-public .family-stat-grid b {
  margin-top: 4px;
  font-size: clamp(16px, 1.8vw, 22px);
}

body.miki-page-public .family-local-nav {
  gap: 5px;
  margin: 18px 0;
  padding: 6px;
  border-radius: 10px;
}

body.miki-page-public .family-local-nav a {
  padding: 7px 10px;
  font-size: 12px;
}

body.miki-page-public .family-story-grid,
body.miki-page-public .family-member-grid,
body.miki-page-public .family-asset-grid,
body.miki-page-public .family-rank-matrix {
  gap: 10px;
}

body.miki-page-public .family-story-card {
  min-height: 170px;
  padding: 18px;
}

body.miki-page-public .family-story-card > span {
  font-size: 30px;
}

body.miki-page-public .family-story-card h2 {
  margin: 8px 0 !important;
  font-size: 20px;
}

body.miki-page-public .family-story-card p {
  font-size: 13px;
  line-height: 1.5;
}

body.miki-page-public .family-section {
  padding-top: 38px;
}

body.miki-page-public .family-section > header,
body.miki-page-public .family-album > header {
  margin-bottom: 18px;
}

body.miki-page-public .family-section > header h2,
body.miki-page-public .family-album > header h1,
body.miki-page-public .family-album-detail > header h1 {
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1.06;
}

body.miki-page-public .family-section > header p,
body.miki-page-public .family-album > header p {
  font-size: 14px;
  line-height: 1.5;
}

body.miki-page-public .family-member-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.miki-page-public .family-member-card {
  padding-bottom: 14px;
  border-radius: 10px;
}

body.miki-page-public .family-member-card > div {
  height: 150px;
  margin-bottom: 12px;
}

body.miki-page-public .family-member-card > span,
body.miki-page-public .family-member-card h3,
body.miki-page-public .family-member-card p {
  margin-inline: 14px;
}

body.miki-page-public .family-member-card h3 {
  font-size: 18px;
}

body.miki-page-public .family-asset-grid.is-transport {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.miki-page-public .family-asset-card {
  grid-template-rows: 150px auto;
  border-radius: 10px;
}

body.miki-page-public .family-asset-card.is-vehicle {
  grid-template-rows: 140px auto;
}

body.miki-page-public .family-asset-card > .family-asset-gallery {
  height: 140px;
}

body.miki-page-public .family-asset-card > div {
  gap: 4px;
  padding: 12px;
}

body.miki-page-public .family-asset-card h3 {
  font-size: 15px;
}

body.miki-page-public .family-asset-card p,
body.miki-page-public .family-asset-card small,
body.miki-page-public .family-asset-metrics li,
body.miki-page-public .family-asset-metrics li b {
  font-size: 10px;
}

body.miki-page-public .family-asset-card b {
  font-size: 16px;
}

body.miki-page-public .family-asset-metrics {
  gap: 4px;
  margin-top: 5px;
}

body.miki-page-public .family-asset-metrics li {
  padding-top: 5px;
}

body.miki-page-public .family-asset-tools {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 10px;
}

body.miki-page-public .family-asset-tools input {
  min-height: 38px;
}

body.miki-page-public .family-rank-card summary {
  min-height: 52px;
  padding: 9px 12px;
}

body.miki-page-public .family-album > header {
  margin: 8px 0 12px;
  padding: 18px;
  border-radius: 12px;
}

body.miki-page-public .family-album-grid.is-single {
  grid-template-columns: minmax(0, 680px);
}

body.miki-page-public .family-album-card {
  min-height: 340px;
  border-radius: 11px;
}

body.miki-page-public .family-album-card > a {
  grid-template-rows: minmax(210px, 1fr) auto;
}

body.miki-page-public .family-album-card img,
body.miki-page-public .family-album-card video {
  max-height: 330px;
}

body.miki-page-public .family-album-card > a > div {
  padding: 14px;
}

body.miki-page-public .family-album-card h2 {
  font-size: 19px;
}

@media (max-width: 760px) {
  body.miki-page-public .family-hub,
  body.miki-page-public .family-album,
  body.miki-page-public .family-album-detail {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  body.miki-page-public .family-hero {
    min-height: 0;
    gap: 12px;
    padding: 20px 16px;
  }

  body.miki-page-public .family-hero__brand {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 11px;
  }

  body.miki-page-public .family-hero__brand > img {
    width: 56px;
  }

  body.miki-page-public .family-hero h1 {
    font-size: 32px;
  }

  body.miki-page-public .family-hero h1 small {
    margin-top: 4px;
    font-size: 15px;
  }

  body.miki-page-public .family-hero__actions .button {
    flex: 1 1 120px;
  }

  body.miki-page-public .family-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.miki-page-public .family-local-nav {
    margin-block: 14px;
  }

  body.miki-page-public .family-story-grid,
  body.miki-page-public .family-member-grid,
  body.miki-page-public .family-asset-grid,
  body.miki-page-public .family-rank-matrix {
    grid-template-columns: minmax(0, 1fr);
  }

  body.miki-page-public .family-section {
    padding-top: 28px;
  }

  body.miki-page-public .family-asset-grid.is-transport {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.miki-page-public .family-asset-grid.is-transport .family-asset-card,
  body.miki-page-public .family-asset-grid.is-transport .family-asset-card.is-vehicle {
    grid-template-rows: 118px auto;
  }

  body.miki-page-public .family-asset-grid.is-transport .family-asset-card > .family-asset-gallery {
    height: 118px;
  }

  body.miki-page-public .family-asset-grid.is-transport .family-asset-card > div {
    padding: 9px;
  }

  body.miki-page-public .family-asset-grid.is-transport .family-asset-card h3 {
    font-size: 13px;
  }

  body.miki-page-public .family-album > header {
    padding: 16px 14px;
  }

  body.miki-page-public .family-album-card,
  body.miki-page-public .family-album-card:first-child {
    min-height: 320px;
  }
}

@media (max-width: 340px) {
  body.miki-page-public .family-asset-grid.is-transport {
    grid-template-columns: minmax(0, 1fr);
  }
}

body:not(.miki-farm-page) .miki-map-layers button,
body:not(.miki-farm-page) .miki-map-filter-head button,
body:not(.miki-farm-page) .miki-map-category,
body:not(.miki-farm-page) .miki-map-panel-toggle {
  border-color: var(--family-line) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: #e8ebef !important;
}

body:not(.miki-farm-page) .miki-map-layers button.is-active {
  border-color: var(--family-gold) !important;
  background: var(--family-gold) !important;
  color: #1c1609 !important;
}

body:not(.miki-farm-page) .miki-map-filter-head button {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--family-gold-soft) !important;
}

body.miki-ui-v9 .command-center-shell.mode-admin[data-tab="family"] .admin-stage {
  width: min(1320px, 100%) !important;
  max-width: 1320px !important;
  margin: 0 auto !important;
  padding: clamp(18px, 1.5vw, 32px) !important;
  box-sizing: border-box;
}

.family-admin {
  position: relative;
  z-index: 1;
  isolation: isolate;
  pointer-events: auto !important;
  width: min(1240px, 100%);
  max-width: 1240px;
  min-width: 0;
  margin-inline: auto;
  display: grid;
  gap: 18px;
}

.family-admin::before,
.family-admin::after {
  pointer-events: none !important;
}

.family-admin form,
.family-admin details,
.family-admin summary,
.family-admin label,
.family-admin input,
.family-admin textarea,
.family-admin select,
.family-admin button,
.family-admin a {
  pointer-events: auto !important;
}

.family-admin input,
.family-admin textarea,
.family-admin select,
.family-admin button,
.family-admin a {
  position: relative;
  z-index: 2;
}

.family-admin img {
  pointer-events: none !important;
  cursor: default !important;
  user-select: none;
  -webkit-user-drag: none;
}

.family-admin details,
.family-admin-form,
.family-admin-card {
  min-width: 0;
  max-width: 100%;
}

.family-admin > header {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 0 8px;
}

.family-admin > header > div {
  max-width: 780px;
}

.family-admin details {
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: var(--family-panel);
  padding: 0 18px 18px;
}

.family-admin details[data-family-assets-admin] {
  overflow: visible;
}

.family-admin summary {
  color: #fff;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
}

.family-admin-form,
.family-admin-card,
.family-admin-card form {
  display: grid;
  gap: 12px;
}

.family-admin-form,
.family-admin-card {
  border: 1px solid var(--family-line);
  border-radius: 12px;
  background: #0c0f12;
  padding: 16px;
}

.family-admin-grid,
.family-admin-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.family-admin-cards {
  margin-bottom: 14px;
}

.family-asset-admin-cards {
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  align-items: start;
  gap: 18px;
}

.family-admin-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.family-admin label {
  display: grid;
  gap: 6px;
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 750;
}

.family-admin input,
.family-admin textarea,
.family-admin select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--family-line);
  border-radius: 8px;
  background: #15191e;
  color: white;
  padding: 9px 11px;
  font: inherit;
}

.family-admin textarea {
  min-height: 120px;
  resize: vertical;
}

.family-admin-hint {
  margin: 0;
  color: var(--family-muted) !important;
  line-height: 1.55;
}

.family-treasury-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--family-line-gold);
  border-radius: 12px;
  background: rgba(244, 182, 63, 0.07);
  padding: 14px;
}

.family-treasury-link > div {
  display: grid;
  gap: 3px;
}

.family-treasury-link span,
.family-treasury-link small {
  color: var(--family-muted);
}

.family-treasury-link b {
  color: var(--family-gold-soft);
  font-size: 22px;
}

.family-marketplace-picker {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--family-line-gold);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(244, 182, 63, 0.09), #0c0f12 42%);
  padding: 16px;
}

.family-marketplace-picker > header,
.family-asset-admin-preview,
.family-asset-admin-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.family-marketplace-picker h3,
.family-marketplace-picker p,
.family-asset-admin-preview h3,
.family-asset-admin-preview p {
  margin: 4px 0 0;
}

.family-marketplace-picker > header span,
.family-asset-admin-preview span {
  color: var(--family-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.family-marketplace-picker > header small {
  color: var(--family-gold-soft);
  font-weight: 800;
}

.family-marketplace-search {
  display: grid;
  grid-template-columns: 190px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.family-marketplace-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.family-marketplace-result {
  overflow: hidden;
  border: 1px solid var(--family-line);
  border-radius: 10px;
  background: #101419;
}

.family-marketplace-result > img {
  width: 100%;
  height: 132px;
  object-fit: contain;
  background: #080a0d;
}

.family-marketplace-result > div {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.family-marketplace-result span {
  color: var(--family-muted);
  font-size: 12px;
}

.family-asset-admin-filter {
  margin: 18px 0 12px;
}

.family-asset-admin-filter label {
  width: min(620px, 100%);
}

.family-asset-admin-filter small {
  color: var(--family-muted);
}

.family-asset-bulk-toolbar {
  position: sticky;
  z-index: 24;
  top: 82px;
  bottom: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  border: 1px solid var(--family-line-gold);
  border-radius: 12px;
  background: rgba(13, 17, 21, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  padding: 13px 14px;
  backdrop-filter: blur(14px);
}

.family-asset-bulk-toolbar > div {
  display: grid;
  gap: 3px;
}

.family-asset-bulk-toolbar b {
  color: #fff;
}

.family-asset-bulk-toolbar span,
.family-asset-card-save-state {
  color: var(--family-muted);
  font-size: 12px;
}

.family-asset-bulk-toolbar button {
  flex: 0 0 auto;
}

.family-asset-bulk-toolbar.is-saving {
  opacity: 0.82;
}

.family-asset-admin-card {
  min-width: 0;
  padding: 18px;
  gap: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.family-admin-order-tools {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--family-line);
  border-radius: 10px;
  background: rgba(244, 182, 63, 0.05);
}

.family-admin-order-tools > span {
  color: var(--family-muted);
  font-size: 12px;
}

.family-admin-order-tools > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.family-admin-order-tools button {
  flex: 1 1 90px;
}

.family-asset-admin-card.is-dirty {
  border-color: var(--family-gold);
  box-shadow: 0 0 0 2px rgba(244, 182, 63, 0.1);
}

.family-asset-card-save-state {
  margin: 0;
  font-weight: 800;
}

.family-asset-admin-card.is-dirty .family-asset-card-save-state {
  color: var(--family-gold-soft);
}

.family-asset-admin-card[hidden] {
  display: none !important;
}

.family-asset-admin-preview {
  align-items: flex-start;
  justify-content: flex-start;
  border-bottom: 1px solid var(--family-line);
  padding-bottom: 14px;
}

.family-asset-admin-preview > img {
  width: 140px;
  height: 100px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
  background: #07090b;
}

.family-asset-admin-preview > .family-asset-gallery {
  width: 190px;
  height: 126px;
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  overflow: hidden;
  border-radius: 8px;
  background: #07090b;
}

.family-asset-admin-preview > .family-asset-admin-media {
  width: 190px;
  height: 126px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  overflow: hidden;
  border-radius: 8px;
  background: #07090b;
  pointer-events: none !important;
}

.family-asset-admin-preview > .family-asset-admin-media img {
  position: static !important;
  width: 100%;
  height: 126px;
  min-width: 0;
  object-fit: cover;
  pointer-events: none !important;
}

.family-asset-admin-preview > .family-asset-admin-media.is-1 {
  grid-template-columns: 1fr;
}

.family-admin .family-asset-admin-card {
  position: relative;
  isolation: isolate;
}

.family-admin .family-asset-admin-card::before,
.family-admin .family-asset-admin-card::after {
  pointer-events: none !important;
}

.family-admin [data-family-assets-admin] input,
.family-admin [data-family-assets-admin] textarea,
.family-admin [data-family-assets-admin] select,
.family-admin [data-family-assets-admin] button,
.family-admin [data-family-assets-admin] label {
  pointer-events: auto !important;
}

.family-asset-photo-manager {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(244, 182, 63, 0.28);
  border-radius: 12px;
  background: rgba(244, 182, 63, 0.05);
  padding: 14px;
}

.family-asset-photo-manager > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.family-asset-photo-manager > header div {
  display: grid;
  gap: 2px;
}

.family-asset-photo-manager > header small,
.family-asset-photo-manager > header span,
.family-asset-photo-list p,
.family-asset-photo-drop small {
  color: var(--family-muted);
  font-size: 11px;
}

.family-asset-photo-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.family-asset-photo-list figure {
  display: grid;
  gap: 6px;
  margin: 0;
}

.family-asset-photo-list img {
  width: 100%;
  height: 104px;
  object-fit: cover;
  border-radius: 8px;
  background: #07090b;
}

.family-asset-photo-list button {
  min-height: 34px;
}

.family-asset-photo-drop {
  min-height: 86px;
  display: grid !important;
  place-content: center;
  gap: 5px;
  border: 1px dashed rgba(244, 182, 63, 0.5);
  border-radius: 10px;
  background: #0b0e11;
  padding: 12px;
  text-align: center;
  cursor: copy;
}

.family-asset-photo-drop:focus-within,
.family-asset-photo-drop:focus {
  border-color: var(--family-gold);
  box-shadow: 0 0 0 3px rgba(244, 182, 63, 0.12);
  outline: none;
}

.family-asset-photo-drop input {
  min-height: 34px;
  padding: 4px;
}

.family-asset-photo-manager.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.family-asset-admin-preview > div {
  min-width: 0;
  flex: 1;
}

.family-asset-admin-preview code {
  overflow-wrap: anywhere;
}

.family-admin .family-check {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.family-admin .family-check input {
  width: 20px;
  min-height: 20px;
}

.family-admin-media {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.family-admin-media li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--family-line);
  padding-top: 9px;
}

.family-admin-table {
  overflow-x: auto;
}

.family-admin table {
  width: 100%;
  border-collapse: collapse;
}

.family-admin th,
.family-admin td {
  border-bottom: 1px solid var(--family-line);
  padding: 10px;
  text-align: left;
}

@media (max-width: 1080px) {
  .miki-map-toolbar__main,
  .miki-map-toolbar__view { gap: 7px; }
  .miki-map-brand { min-width: 126px; }
  .miki-map-search { width: min(240px, 23vw); }
  .miki-map-draw,
  .miki-map-filter-toggle,
  .miki-map-layers button { padding-inline: 10px; }
  .miki-map-layers button { min-width: 80px; }
  .miki-map-panel { left: min(493px, calc(100vw - 348px)); }
  .family-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .family-story-grid { grid-template-columns: 1fr; }
  .family-story-card { min-height: 0; }
  .family-member-grid,
  .family-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-asset-grid.is-transport,
  .family-marketplace-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-album-card,
  .family-album-card:first-child { grid-column: span 6; }
}

@media (max-width: 760px) {
  .family-hub,
  .family-album,
  .family-album-detail { width: min(100% - 20px, 1280px); padding-top: 16px; }
  .family-hero { min-height: 0; padding: 28px 20px; border-radius: 14px; }
  .family-hero__brand { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: flex-start; gap: 14px; }
  .family-hero__brand > img { width: 68px; }
  .family-hero h1 { overflow-wrap: anywhere; font-size: clamp(30px, 9vw, 42px); letter-spacing: -0.04em; }
  .family-hero h1 small { display: block; margin-top: 7px; font-size: 18px; }
  .family-hero__actions .button { flex: 1 1 100%; text-align: center; }
  .family-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-local-nav { top: auto; }
  .family-story-grid { scroll-margin-top: 78px; }
  .family-section { scroll-margin-top: 12px; }
  .family-member-grid,
  .family-asset-grid,
  .family-media-grid,
  .family-admin-grid,
  .family-admin-cards,
  .family-admin-inline,
  .family-rank-matrix { grid-template-columns: 1fr; }
  .family-asset-grid.is-transport,
  .family-marketplace-results,
  .family-marketplace-search,
  .family-asset-tools { grid-template-columns: 1fr; }
  .family-asset-card { grid-template-columns: 1fr; grid-template-rows: 200px auto; }
  .family-album > header,
  .family-admin > header { align-items: flex-start; flex-direction: column; }
  .family-album > header { margin-top: 0; padding: 22px 18px; }
  .family-album-detail { margin-top: 0; padding: 22px 18px; }
  .family-album > header > div:last-child { width: 100%; }
  .family-album > header .button { flex: 1 1 140px; }
  .family-album-card,
  .family-album-card:first-child { grid-column: 1 / -1; min-height: 360px; }
  .miki-map-shell { width: 100vw; height: 100vh; height: 100dvh; min-height: 0; }
  .miki-map-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
  .miki-map-toolbar__main { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand brand" "search draw" "filters filters"; gap: 8px; width: 100%; }
  .miki-map-brand { grid-area: brand; width: 100%; min-width: 0; }
  .miki-map-search { grid-area: search; width: 100%; min-width: 0; }
  .miki-map-draw { grid-area: draw; }
  .miki-map-filter-toggle { grid-area: filters; width: 100%; }
  .miki-map-toolbar__view { justify-content: flex-start; gap: 8px; }
  .miki-map-layers { flex: 0 1 auto; }
  .miki-map-layers button { min-width: 92px; }
  .miki-map-panel { top: 206px; left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 216px); }
  .miki-map-wordmark { right: 12px; bottom: 12px; font-size: 22px; }
  .miki-map-wordmark img { width: 32px; height: 32px; }
  .family-admin-media li { grid-template-columns: minmax(0, 1fr); }
  .family-marketplace-picker > header,
  .family-asset-admin-preview,
  .family-asset-admin-filter,
  .family-treasury-link,
  .family-asset-bulk-toolbar { align-items: flex-start; flex-direction: column; }
  .family-treasury-link .button,
  .family-asset-bulk-toolbar button { width: 100%; }
  .family-asset-bulk-toolbar { position: static; }
  .family-asset-admin-preview > img { width: 100%; height: 180px; }
  .family-asset-admin-preview > .family-asset-gallery { width: 100%; height: 190px; }
  .family-asset-admin-preview > .family-asset-admin-media { width: 100%; height: 190px; }
  .family-asset-admin-preview > .family-asset-admin-media img { height: 190px; }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .family-asset-admin-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .miki-map-panel { transition: none; }
}

/* Map v19: one canvas for thousands of markers and a compact task-first filter. */
.miki-map-marker-canvas {
  position: absolute;
  max-width: none !important;
  pointer-events: none;
  image-rendering: auto;
}

.miki-map-panel {
  left: min(602px, calc(100vw - 432px));
  width: min(420px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 84px));
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto auto;
}

.miki-map-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

body.miki-map-page .miki-map-presets button {
  min-width: 0;
  min-height: 38px;
  padding: 0 7px !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035) !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.miki-map-page .miki-map-presets button:hover,
body.miki-map-page .miki-map-presets button.is-active {
  border-color: color-mix(in srgb, var(--family-gold) 72%, transparent) !important;
  color: #171208 !important;
  background: var(--family-gold) !important;
}

.miki-map-selection {
  display: flex;
  align-items: center;
  min-height: 28px;
  color: #d7d9dc;
  font-size: 12px;
  font-weight: 800;
}

.miki-map-category-browser {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(8, 10, 12, 0.66);
}

.miki-map-category-browser:not([open]) {
  display: block;
}

.miki-map-category-browser > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  color: #f1f2f4;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.miki-map-category-browser > summary::-webkit-details-marker {
  display: none;
}

.miki-map-category-browser > summary::after {
  content: "+";
  color: var(--family-gold);
  font-size: 19px;
}

.miki-map-category-browser[open] > summary::after {
  content: "−";
}

.miki-map-category-browser[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.miki-map-category-browser .miki-map-categories {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 320px;
  padding: 8px;
  scrollbar-width: thin;
}

.miki-map-category-browser .miki-map-category {
  min-width: 0;
  min-height: 46px;
  padding: 7px 8px;
  white-space: normal;
}

.miki-map-category-browser .miki-map-category span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.16;
}

.miki-map-category-browser .miki-map-category[aria-pressed="false"] {
  opacity: 0.64;
}

.miki-map-category-browser .miki-map-category[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--marker-color, var(--family-gold)) 55%, rgba(255, 255, 255, 0.1)) !important;
  background: rgba(255, 255, 255, 0.075) !important;
}

.miki-map-panel > footer {
  gap: 7px 12px;
}

@media (max-width: 1080px) {
  .miki-map-panel {
    left: min(493px, calc(100vw - 432px));
  }
  .miki-map-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .miki-map-panel {
    top: 214px;
    bottom: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: none;
  }
  .miki-map-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .miki-map-category-browser .miki-map-categories {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }
}

/* Reassert the public mobile density after the map/mobile compatibility block. */
@media (max-width: 760px) {
  body.miki-page-public .family-hub,
  body.miki-page-public .family-album,
  body.miki-page-public .family-album-detail {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  body.miki-page-public .family-hero {
    min-height: 0;
    gap: 12px;
    padding: 20px 16px;
    border-radius: 14px;
  }

  body.miki-page-public .family-hero__brand {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 11px;
  }

  body.miki-page-public .family-hero__brand > img { width: 56px; }
  body.miki-page-public .family-hero h1 { font-size: 32px; }
  body.miki-page-public .family-hero h1 small { margin-top: 4px; font-size: 15px; }
  body.miki-page-public .family-hero__actions .button { flex: 1 1 120px; }
  body.miki-page-public .family-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.miki-page-public .family-local-nav { margin-block: 14px; }
  body.miki-page-public .family-section { padding-top: 28px; }

  body.miki-page-public .family-story-grid,
  body.miki-page-public .family-member-grid,
  body.miki-page-public .family-asset-grid,
  body.miki-page-public .family-rank-matrix {
    grid-template-columns: minmax(0, 1fr);
  }

  body.miki-page-public .family-asset-grid.is-transport {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.miki-page-public .family-asset-grid.is-transport .family-asset-card,
  body.miki-page-public .family-asset-grid.is-transport .family-asset-card.is-vehicle {
    grid-template-rows: 118px auto;
  }

  body.miki-page-public .family-asset-grid.is-transport .family-asset-card > .family-asset-gallery { height: 118px; }
  body.miki-page-public .family-asset-grid.is-transport .family-asset-card > div { padding: 9px; }
  body.miki-page-public .family-asset-grid.is-transport .family-asset-card h3 { font-size: 13px; }
  body.miki-page-public .family-album > header { padding: 16px 14px; }

  body.miki-page-public .family-album-card,
  body.miki-page-public .family-album-card:first-child {
    min-height: 320px;
  }
}

@media (max-width: 340px) {
  body.miki-page-public .family-asset-grid.is-transport {
    grid-template-columns: minmax(0, 1fr);
  }
}
