.meta-shell {
  width: min(100% - 40px, 1260px);
  margin: 0 auto;
  padding: 42px 0 88px;
}

.meta-hero.page-hero {
  width: 100%;
}

.meta-state {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: #53645a;
  text-align: center;
}

.meta-state[hidden],
.meta-dashboard[hidden],
.meta-detail[hidden] {
  display: none;
}

.meta-state.is-error { color: #b42318; }

.meta-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d6e4da;
  border-top-color: #238442;
  border-radius: 50%;
  animation: meta-spin .75s linear infinite;
}

@keyframes meta-spin { to { transform: rotate(360deg); } }

.meta-dashboard { display: grid; gap: 24px; }

.meta-freshness {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid #cae1d1;
  border-radius: 6px;
  background: #eef8f1;
  color: #31523e;
}

.meta-freshness > div { display: flex; align-items: center; gap: 10px; }
.meta-freshness p { margin: 0; color: #607268; }
.meta-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #238442; box-shadow: 0 0 0 4px rgb(35 132 66 / 12%); }

.meta-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #d5e0d8;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.meta-summary article { padding: 24px; }
.meta-summary article + article { border-left: 1px solid #e0e8e2; }
.meta-summary span { display: block; color: #697970; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.meta-summary strong { display: block; margin-top: 7px; color: #102c1e; font-size: clamp(1.55rem, 4vw, 2.35rem); }

.meta-weekly { padding: clamp(24px, 4vw, 38px); border: 1px solid #cfe0d4; border-top: 5px solid #e2b945; border-radius: 7px; background: #f2f8f4; }
.meta-weekly-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: end; margin-bottom: 22px; }
.meta-weekly-heading .eyebrow { grid-column: 1 / -1; margin: 0; color: #238442; font-size: .78rem; font-weight: 900; }
.meta-weekly-heading h2 { margin: 0; color: #142219; font-size: clamp(1.75rem, 4vw, 2.35rem); }
.meta-weekly-heading > p:last-child { margin: 0; color: #607067; font-size: .86rem; }
.meta-weekly-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.meta-weekly-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; min-height: 142px; padding: 16px; border: 1px solid #d8e4dc; border-radius: 7px; background: #fff; color: inherit; text-decoration: none; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
a.meta-weekly-card:hover, a.meta-weekly-card:focus-visible { border-color: #63ad7a; box-shadow: 0 10px 24px rgba(16, 44, 30, .09); transform: translateY(-2px); outline: none; }
.meta-weekly-cards { position: relative; width: 82px; height: 108px; align-self: center; }
.meta-weekly-cards img { position: absolute; top: 5px; width: 62px; aspect-ratio: 5 / 7; border-radius: 5px; background: #edf3ef; object-fit: contain; box-shadow: 0 5px 13px rgba(16, 44, 30, .15); }
.meta-weekly-cards img:first-child { left: 0; z-index: 2; transform: rotate(-3deg); }
.meta-weekly-cards img:nth-child(2) { right: 0; transform: rotate(4deg); }
.meta-weekly-cards.is-single img:first-child { left: 10px; transform: none; }
.meta-weekly-body { min-width: 0; }
.meta-weekly-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #e4f5e9; color: #176f38; font-size: .68rem; font-weight: 900; }
.meta-weekly-card.is-down .meta-weekly-badge, .meta-weekly-card.is-out .meta-weekly-badge { background: #f7e8e5; color: #a23a2d; }
.meta-weekly-card.is-steady .meta-weekly-badge { background: #edf0ee; color: #5e6d64; }
.meta-weekly-body h3 { margin: 9px 0 3px; color: #142219; font-size: .98rem; line-height: 1.25; overflow-wrap: anywhere; }
.meta-weekly-body > strong { color: #31523e; font-size: .9rem; }
.meta-weekly-deltas { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 7px; color: #687870; font-size: .7rem; line-height: 1.35; }
.meta-weekly-empty { margin: 0; padding: 18px; border: 1px dashed #bfcfc4; border-radius: 6px; color: #607067; text-align: center; }
.meta-weekly-toggle { display: none; }
.meta-weekly-toggle[hidden] { display: none; }
button.meta-weekly-toggle:hover, button.meta-weekly-toggle:focus-visible { border-color: #63ad7a; background: #edf7f0; color: #0d5129; outline: 2px solid #8ec7a1; outline-offset: 2px; }
button.meta-weekly-toggle:active { background: #e2f2e7; color: #0d5129; }

.meta-ranking-panel {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #d5e0d8;
  border-top: 5px solid #238442;
  border-radius: 7px;
  background: #fff;
}

.meta-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .75fr);
  gap: 30px;
  align-items: end;
  margin-bottom: 24px;
}

.meta-section-heading .eyebrow { margin: 0 0 7px; color: #238442; font-size: .78rem; font-weight: 900; }
.meta-section-heading h2 { margin: 0; color: #142219; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.meta-section-heading p { margin: 9px 0 0; color: #64736a; line-height: 1.55; }

.meta-controls { display: grid; grid-template-columns: 1fr 170px; gap: 12px; }
.meta-controls label { display: grid; gap: 7px; color: #43564a; font-size: .82rem; font-weight: 800; }
.meta-controls input, .meta-controls select { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid #cddbd1; border-radius: 6px; background: #fff; color: #142219; font: inherit; }

.meta-deck-list { display: grid; gap: 10px; }
.meta-deck-row {
  display: grid;
  grid-template-columns: 52px minmax(240px, 1.35fr) minmax(160px, .75fr) minmax(160px, .75fr) 115px;
  gap: 18px;
  align-items: center;
  min-height: 106px;
  padding: 14px 16px;
  border: 1px solid #dbe5de;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.meta-deck-row:hover, .meta-deck-row:focus-visible { border-color: #63ad7a; background: #f5fbf7; transform: translateY(-1px); outline: none; }
.meta-rank { color: #1c6f39; font-size: 1.05rem; font-weight: 900; text-align: center; }
.meta-rank.is-unranked { color: #7a887f; font-size: .74rem; }
.meta-deck-main { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; align-items: center; }
.meta-deck-cards { position: relative; width: 82px; height: 84px; }
.meta-deck-cards img { position: absolute; top: 0; width: 52px; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 4px; background: #f1f5f2; box-shadow: 0 5px 12px rgba(19, 42, 28, .12); }
.meta-deck-cards img:first-child { left: 0; z-index: 2; transform: rotate(-3deg); }
.meta-deck-cards img:nth-child(2) { right: 0; transform: rotate(3deg); }
.meta-deck-cards.is-single img:first-child { left: 15px; transform: none; }
.meta-deck-main h3 { margin: 0; color: #142219; font-size: 1.08rem; overflow-wrap: anywhere; }
.meta-deck-main p { margin: 5px 0 0; color: #6a7970; font-size: .8rem; }
.meta-metric { min-width: 0; }
.meta-metric-head { display: flex; justify-content: space-between; gap: 8px; color: #4d5f54; font-size: .78rem; font-weight: 800; }
.meta-bar { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #e8eee9; }
.meta-bar span { display: block; height: 100%; border-radius: inherit; background: #238442; }
.meta-metric.performance .meta-bar span { background: #e2b945; }
.meta-record { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: #53645a; font-size: .82rem; line-height: 1.55; }
.meta-record strong { flex: 0 0 100%; color: #142219; font-size: 1rem; }
.meta-chip { display: inline-flex; margin-top: 0; padding: 4px 8px; border-radius: 999px; background: #f1f4f2; color: #607067; font-size: .68rem; font-weight: 900; }
.meta-chip.low { background: #fff3d3; color: #82610d; }
.meta-chip.other { background: #edf0ee; color: #5b6760; }
.meta-empty { padding: 32px; color: #66766d; text-align: center; }

.meta-methodology { border: 1px solid #d5e0d8; border-radius: 6px; background: #fff; }
.meta-methodology summary { padding: 20px 22px; color: #173523; font-weight: 900; cursor: pointer; }
.meta-methodology > div { padding: 0 22px 22px; color: #5d6d64; line-height: 1.7; }
.meta-methodology p { margin: 0 0 10px; }
.meta-methodology a { color: #176f38; font-weight: 800; }

.meta-detail { display: grid; gap: 24px; }
.meta-detail-back { display: inline-flex; min-height: 40px; align-items: center; justify-self: start; border: 0; padding: 0 2px; background: transparent; color: #176f38; font-weight: 900; cursor: pointer; transition: color .16s ease, transform .16s ease; }
.meta-detail-back:hover,
.meta-detail-back:focus-visible { background: transparent; color: #0d5129; text-decoration: underline; text-underline-offset: 4px; transform: translateX(-2px); }
.meta-detail-back:focus-visible { border-radius: 2px; outline: 2px solid #8ec7a1; outline-offset: 5px; }
.meta-detail-bottom-actions { display: flex; justify-content: center; padding: 4px 0 12px; }
.meta-detail-back-bottom { min-height: 48px; padding: 0 22px; border: 1px solid #8db49a; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(16, 44, 30, .08); }
.meta-detail-back-bottom:hover,
.meta-detail-back-bottom:focus-visible { background: #edf7f0; text-decoration: none; }
.meta-detail-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: end; padding: clamp(30px, 5vw, 54px); border-radius: 8px; background: #102c1e; color: #fff; }
.meta-detail-hero .eyebrow { margin: 0 0 10px; color: #65dc91; font-size: .78rem; font-weight: 900; }
.meta-detail-hero h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: .98; overflow-wrap: anywhere; }
.meta-detail-rank { color: #f2d473; font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 900; }
.meta-share-button { min-height: 40px; padding: 0 14px; border: 1px solid #8db49a; border-radius: 6px; background: #fff; color: #176f38; font: inherit; font-size: .82rem; font-weight: 900; cursor: pointer; white-space: nowrap; transition: background-color .16s ease, transform .16s ease; }
.meta-share-button:hover, .meta-share-button:focus-visible { border-color: #63ad7a; background: #edf7f0; color: #0d5129; transform: translateY(-1px); outline: 2px solid #8ec7a1; outline-offset: 2px; }
.meta-share-button:disabled { border-color: #b8ccc0; background: #f3f6f4; color: #607067; cursor: wait; transform: none; }
.meta-qr-button { min-height: 40px; padding: 0 14px; border: 1px solid #8db49a; border-radius: 6px; background: #fff; color: #176f38; font: inherit; font-size: .82rem; font-weight: 900; cursor: pointer; white-space: nowrap; }
.meta-qr-button:hover, .meta-qr-button:focus-visible { border-color: #63ad7a; background: #edf7f0; color: #0d5129; outline: 2px solid #8ec7a1; outline-offset: 2px; }
.meta-share-status { flex-basis: 100%; max-width: 290px; color: #607067; font-size: .72rem; font-weight: 700; line-height: 1.35; text-align: right; }
.meta-detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #d5e0d8; border-radius: 6px; background: #fff; overflow: hidden; }
.meta-detail-stats div { padding: 22px; }
.meta-detail-stats div + div { border-left: 1px solid #e0e8e2; }
.meta-detail-stats dt { color: #687870; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.meta-detail-stats dd { margin: 6px 0 0; color: #142219; font-size: 1.35rem; font-weight: 900; }
.meta-key-cards, .meta-samples { padding: clamp(24px, 4vw, 38px); border: 1px solid #d5e0d8; border-radius: 6px; background: #fff; }
.meta-key-cards h2, .meta-samples > h2 { margin: 0 0 20px; color: #142219; }
.meta-key-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.meta-key-card { width: 118px; }
.meta-key-card img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 5px; background: #f1f5f2; }
.meta-key-card strong { display: block; margin-top: 7px; font-size: .82rem; overflow-wrap: anywhere; }
.meta-sample-list { display: grid; gap: 16px; }
.meta-sample { padding: 22px; border: 1px solid #dce5df; border-radius: 6px; }
.meta-sample-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.meta-sample-head h3 { margin: 0; color: #142219; }
.meta-sample-head p { margin: 7px 0 0; color: #687870; font-size: .82rem; }
.meta-sample-head a { color: #176f38; font-weight: 900; white-space: nowrap; }
.meta-sample-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 14px; }
.meta-share-dialog { width: min(940px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: 0 28px 80px rgba(7, 31, 20, .35); }
.meta-share-dialog::backdrop { background: rgba(7, 31, 20, .72); backdrop-filter: blur(3px); }
.meta-share-dialog-panel { padding: clamp(18px, 3vw, 30px); background: #f5f8f6; }
.meta-share-dialog-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.meta-share-dialog-head h2 { margin: 0; color: #142219; }
.meta-share-dialog-head p { margin: 7px 0 0; color: #607067; line-height: 1.55; }
.meta-share-dialog-close { flex: 0 0 42px; height: 42px; border: 1px solid #cbd8cf; border-radius: 50%; background: #fff; color: #173523; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.meta-share-preview { display: block; width: 100%; max-height: min(62dvh, 820px); border: 1px solid #d4dfd7; border-radius: 7px; background: #edf3ef; object-fit: contain; }
.meta-share-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.meta-share-save, .meta-share-direct { min-height: 46px; padding: 0 18px; border-radius: 6px; font: inherit; font-weight: 900; cursor: pointer; }
.meta-share-save { border: 1px solid #8db49a; background: #fff; color: #176f38; }
.meta-share-save:hover, .meta-share-save:focus-visible { border-color: #63ad7a; background: #edf7f0; color: #0d5129; outline: 2px solid #8ec7a1; outline-offset: 2px; }
.meta-share-save:active { background: #e2f2e7; color: #0d5129; }
.meta-share-direct { border: 1px solid #238442; background: #238442; color: #fff; }
.meta-share-direct:disabled { border-color: #b8c5bd; background: #b8c5bd; cursor: not-allowed; }
.meta-share-dialog-status { min-height: 1.3em; margin: 10px 0 0; color: #607067; font-size: .78rem; text-align: right; }
.meta-qr-dialog { width: min(620px, calc(100% - 24px)); }
.meta-qr-deck-info { padding: 13px 16px; border: 1px solid #cfe0d5; border-radius: 8px; background: #eaf5ed; }
.meta-qr-deck-info h3 { margin: 0; color: #142219; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.meta-qr-stage { display: grid; justify-items: center; margin-top: 18px; padding: 16px; border: 1px solid #d8e3dc; border-radius: 8px; background: #fff; }
.meta-qr-preview { display: block; width: min(100%, 360px); aspect-ratio: 1; object-fit: contain; }
.meta-qr-preview[hidden] { display: none; }
.meta-qr-stage p { margin: 10px 0 0; color: #607067; font-size: .8rem; font-weight: 700; text-align: center; }
.meta-list-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.meta-card-section h4 { margin: 0 0 10px; color: #53645a; font-size: .8rem; text-transform: uppercase; }
.meta-card-line { position: relative; display: grid; grid-template-columns: 34px 58px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 78px; padding: 8px 7px; border-top: 1px solid #e7eee9; border-radius: 4px; transition: background-color .16s ease; }
.meta-card-line:hover { background: #f4faf6; }
.meta-card-line img { position: relative; z-index: 1; width: 58px; height: 70px; object-fit: contain; border-radius: 4px; background: #f2f6f3; box-shadow: 0 3px 9px rgba(16, 44, 30, .1); cursor: zoom-in; transform-origin: center; transition: transform .18s ease, box-shadow .18s ease; }
.meta-card-line span:first-child { color: #238442; font-weight: 900; text-align: center; }
.meta-card-line strong { color: #142219; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.meta-energy-section { display: flex; align-items: center; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #e1e9e3; }
.meta-energy-section h4 { flex: 0 0 auto; margin: 0; color: #53645a; font-size: .8rem; text-transform: uppercase; }
.meta-energy-list { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-energy-badge { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border: 1px solid #d8e3dc; border-radius: 999px; background: #f7faf8; color: #173523; }
.meta-energy-badge strong { font-size: .82rem; }
.meta-energy-symbol { display: block; width: 28px; height: 28px; object-fit: contain; }

@media (hover: hover) and (pointer: fine) {
  .meta-card-line img:hover, .meta-card-line img:focus-visible { z-index: 20; transform: scale(2.7); box-shadow: 0 20px 42px rgba(16, 44, 30, .32); outline: 2px solid #238442; outline-offset: 2px; }
}

@media (max-width: 900px) {
  .meta-section-heading { grid-template-columns: 1fr; }
  .meta-deck-row { grid-template-columns: 42px minmax(220px, 1fr) minmax(140px, .75fr); }
  .meta-record { grid-column: 2 / -1; }
  .meta-detail-stats { grid-template-columns: 1fr 1fr; }
  .meta-detail-stats div:nth-child(3) { border-left: 0; border-top: 1px solid #e0e8e2; }
  .meta-detail-stats div:nth-child(4) { border-top: 1px solid #e0e8e2; }
  .meta-weekly-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .meta-shell { width: min(100% - 24px, 1260px); padding: 28px 0 58px; }
  .meta-freshness { align-items: flex-start; flex-direction: column; }
  .meta-summary { grid-template-columns: 1fr 1fr; }
  .meta-summary article:nth-child(3) { border-left: 0; border-top: 1px solid #e0e8e2; }
  .meta-summary article:nth-child(4) { border-top: 1px solid #e0e8e2; }
  .meta-weekly-heading { grid-template-columns: 1fr; }
  .meta-weekly-toggle { display: inline-flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; margin-top: -4px; border: 1px solid #8db49a; border-radius: 6px; background: #fff; color: #176f38; font: inherit; font-weight: 900; cursor: pointer; }
  .meta-weekly-list { display: none; grid-template-columns: 1fr; margin-top: 12px; }
  .meta-weekly.is-expanded .meta-weekly-list { display: grid; }
  .meta-controls { grid-template-columns: 1fr; }
  .meta-deck-row { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .meta-metric, .meta-record { grid-column: 2; }
  .meta-detail-hero { grid-template-columns: 1fr; }
  .meta-detail-rank { justify-self: start; }
  .meta-detail-stats { grid-template-columns: 1fr 1fr; }
  .meta-list-sections { grid-template-columns: 1fr; }
  .meta-sample-head { align-items: flex-start; flex-direction: column; }
  .meta-sample-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .meta-sample-actions > button { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 44px; padding: 5px 4px; font-size: .68rem; line-height: 1.2; text-align: center; white-space: normal; }
  .meta-sample-actions > a { display: inline-flex; align-items: center; min-width: 0; min-height: 44px; font-size: .72rem; line-height: 1.2; text-decoration: underline; text-underline-offset: 2px; white-space: normal; }
  .meta-share-status { grid-column: 1 / -1; max-width: none; text-align: left; }
  .meta-share-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .meta-share-dialog-status { text-align: left; }
  .meta-card-line { grid-template-columns: 32px 54px minmax(0, 1fr); min-height: 73px; }
  .meta-card-line img { width: 54px; height: 65px; }
  .meta-energy-section { align-items: flex-start; flex-direction: column; gap: 9px; }
  .meta-detail-back-bottom { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .meta-spinner { animation: none; }
  .meta-deck-row { transition: none; }
  .meta-card-line, .meta-card-line img { transition: none; }
}
