:root {
  color-scheme: dark;
  --bg: #070909;
  --bg-2: #101211;
  --surface: rgba(19, 23, 22, 0.92);
  --surface-2: rgba(28, 31, 29, 0.92);
  --line: rgba(235, 241, 238, 0.16);
  --line-strong: rgba(235, 241, 238, 0.28);
  --text: #f4f7f4;
  --muted: #aeb8b4;
  --muted-2: #7f8b87;
  --cyan: #31c6d4;
  --cyan-deep: #087b89;
  --gold: #d4ae62;
  --red: #d75245;
  --green: #62c987;
  --violet: #9a8ee8;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --radius-sm: 6px;
  --content: min(1560px, calc(100vw - 36px));
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eeefeb;
  --bg-2: #f7f7f4;
  --surface: rgba(255, 255, 252, 0.94);
  --surface-2: rgba(244, 244, 239, 0.96);
  --line: rgba(18, 22, 20, 0.14);
  --line-strong: rgba(18, 22, 20, 0.28);
  --text: #161b19;
  --muted: #59635f;
  --muted-2: #75807b;
  --shadow: 0 16px 42px rgba(35, 39, 37, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 260px),
    linear-gradient(90deg, rgba(49, 198, 212, 0.08), transparent 38%),
    var(--bg);
}

.background-stage {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(90deg, rgba(5, 7, 7, 0.56), rgba(5, 7, 7, 0.26)),
    var(--app-background-1);
  background-size: cover;
  background-position: center;
  filter: brightness(0.9) saturate(1.06);
  transition: background-image 1.2s ease, filter 0.2s ease;
}

.background-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.14);
}

.background-stage-panel {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
.file-button {
  color: var(--text);
}

button {
  cursor: pointer;
}

.app-shell {
  width: var(--content);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 36px;
}

.app-shell-simple {
  display: grid;
  gap: 16px;
}

.home-view {
  display: grid;
  gap: 16px;
}

.home-view[hidden],
.event-page[hidden],
.operator-master-page[hidden] {
  display: none !important;
}

.topbar {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 760px);
  gap: 18px;
  align-items: center;
}

.simple-topbar {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.brand,
.top-actions,
.tabs,
.control-row,
.hero-actions,
.panel-head {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(49, 198, 212, 0.22), rgba(212, 174, 98, 0.16));
  color: var(--text);
  font-weight: 950;
  letter-spacing: 0;
}

.brand h1,
.view-head h2,
.hero h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  justify-content: end;
  gap: 8px;
}

.search {
  min-width: 0;
  flex: 1;
  height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search span {
  text-align: center;
  color: var(--cyan);
  font-size: 20px;
}

.search input,
.note-box {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search input::placeholder {
  color: var(--muted-2);
}

.icon-button,
.primary-button,
.ghost-button,
.small-button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.file-button input {
  display: none;
}

.primary-button,
.ghost-button,
.small-button {
  padding: 0 14px;
  font-weight: 850;
}

.file-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.file-command input {
  display: none;
}

.wide-command {
  width: 100%;
}

.primary-button {
  border-color: rgba(49, 198, 212, 0.72);
  background: linear-gradient(135deg, rgba(49, 198, 212, 0.92), rgba(8, 123, 137, 0.92));
  color: #061011;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
}

a.ghost-button,
a.icon-button {
  text-decoration: none;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--text);
  font-size: 12px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 6px;
  margin: 14px 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  backdrop-filter: blur(12px);
}

.tab {
  min-width: 110px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.tab.is-active,
.tab:hover,
.icon-button:hover,
.ghost-button:hover,
.small-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

main {
  display: block;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.simple-hero {
  min-height: 390px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.06);
  transform: scale(1.02);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 7, 0.92) 0%, rgba(5, 7, 7, 0.58) 48%, rgba(5, 7, 7, 0.2) 100%),
    linear-gradient(0deg, rgba(5, 7, 7, 0.88), transparent 44%);
}

:root[data-theme="light"] .hero::after {
  background:
    linear-gradient(90deg, rgba(247, 247, 244, 0.94) 0%, rgba(247, 247, 244, 0.68) 52%, rgba(247, 247, 244, 0.16) 100%),
    linear-gradient(0deg, rgba(247, 247, 244, 0.86), transparent 44%);
}

.hero-overlay {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  min-height: 360px;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: clamp(22px, 4vw, 46px);
}

.hero h2 {
  font-size: clamp(34px, 5vw, 76px);
  line-height: 0.98;
}

.hero p:not(.eyebrow) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.7;
}

.hero-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.total-progress {
  width: min(520px, 100%);
  display: grid;
  gap: 10px;
}

.total-progress-main {
  display: flex;
  align-items: end;
  gap: 12px;
}

.total-progress-main strong {
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.9;
}

.total-progress-main span {
  color: var(--muted);
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric-grid-simple {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.metric {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.metric strong {
  display: block;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-grid,
.source-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.65fr);
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel,
.event-card,
.operator-card,
.module-row,
.source-card,
.roadmap-card,
.news-item,
.next-item {
  border-radius: var(--radius);
}

.panel {
  padding: 16px;
}

.panel-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel h3,
.view-head h2 {
  font-size: clamp(22px, 2.4vw, 34px);
}

.muted {
  color: var(--muted);
  line-height: 1.7;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  gap: 8px;
}

.progress-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.bar {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.bar span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
}

.next-list,
.news-strip,
.source-grid,
.roadmap-grid,
.health-list {
  display: grid;
  gap: 10px;
}

.next-item,
.news-item {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.next-list--priority {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.next-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.next-item-copy {
  display: grid;
  min-width: 0;
}

.next-item-art {
  width: 48px;
  height: 60px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(1, 5, 4, 0.72);
}

.next-item-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.next-item strong,
.news-item strong {
  display: block;
  margin-bottom: 6px;
}

.next-item-focus {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.next-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-item p,
.news-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.view-head {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.history-panel {
  display: grid;
  gap: 12px;
}

.history-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.history-card {
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.history-card:hover,
.history-card:focus {
  border-color: rgba(49, 198, 212, 0.7);
  outline: 0;
  transform: translateY(-2px);
}

.medal-mark {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 54px;
  height: 60px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  z-index: 2;
}

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

.medal-mark.is-pending {
  background: transparent;
}

.medal-mark.is-pending img {
  opacity: 0.72;
  filter: grayscale(1) brightness(0.7) contrast(0.9);
}

.medal-mark.is-complete {
  background: transparent;
}

.medal-mark.is-complete img {
  filter: none;
}

.control-row {
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

select,
.toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
}

select {
  min-width: 150px;
  padding: 0 34px 0 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

.event-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.event-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.event-image.is-contain::before {
  content: "";
  position: absolute;
  inset: -18px;
  background-image:
    linear-gradient(rgba(5, 8, 8, 0.42), rgba(5, 8, 8, 0.62)),
    var(--event-banner-image);
  background-position: center;
  background-size: cover;
  filter: blur(14px) saturate(0.7);
  transform: scale(1.08);
}

.event-image img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--event-banner-position, center);
  display: block;
}

.event-image.is-zoomed > img {
  transform: scale(var(--event-banner-scale, 1));
  transform-origin: var(--event-banner-position, center);
}

.event-image.is-contain > img {
  z-index: 1;
  object-fit: contain;
}

.event-image .badge-row {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
}

.card-body {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.card-body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.card-meta,
.card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 7, 7, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.badge.gold { border-color: rgba(212, 174, 98, 0.65); color: var(--gold); }
.badge.cyan { border-color: rgba(49, 198, 212, 0.65); color: var(--cyan); }
.badge.green { border-color: rgba(98, 201, 135, 0.65); color: var(--green); }
.badge.red { border-color: rgba(215, 82, 69, 0.65); color: var(--red); }

.operator-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.operator-card {
  min-height: 190px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.operator-top {
  min-height: 76px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.operator-avatar {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--gold);
  font-weight: 950;
}

.operator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.operator-name {
  min-width: 0;
}

.operator-name h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.3;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
}

.check-grid label,
.task-row label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-grid input,
.task-row input,
.toggle input {
  accent-color: var(--cyan);
}

.table-list {
  display: grid;
  gap: 8px;
}

.module-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 130px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.module-row strong {
  display: block;
}

.module-row span,
.module-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.source-layout {
  align-items: start;
}

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

.source-card,
.roadmap-card {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.source-card {
  border-left: 4px solid var(--cyan);
}

.source-card[data-priority="secondary"] { border-left-color: var(--gold); }
.source-card[data-priority="fallback"] { border-left-color: var(--red); }
.source-card[data-priority="local"] { border-left-color: var(--green); }

.source-card h3,
.roadmap-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.source-card p,
.roadmap-card p,
.roadmap-card li {
  color: var(--muted);
  line-height: 1.65;
}

.source-card code,
.command {
  display: block;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--cyan);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.health-list {
  margin-top: 14px;
}

.health {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.health span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.health strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

.roadmap-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.detail-dialog {
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100vh - 38px);
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow);
}

.event-page {
  --event-page-image: none;
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 126px);
}

.event-page::before,
.event-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.event-page::before {
  z-index: -2;
  background-image: var(--event-page-image);
  background-position: center;
  background-size: cover;
  filter: brightness(0.82) saturate(1.06);
}

.event-page::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 7, 7, 0.62), rgba(4, 7, 7, 0.2) 58%, rgba(4, 7, 7, 0.48)),
    linear-gradient(180deg, rgba(4, 7, 7, 0.06), var(--bg) 92%);
}

.event-page-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.event-page-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.event-page-toolbar .icon-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
}

.event-page-toolbar .eyebrow {
  margin: 0;
}

.event-page .detail-hero {
  min-height: 340px;
  margin-top: 18px;
  padding: 32px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(90deg, rgba(4, 7, 7, 0.94), rgba(4, 7, 7, 0.44) 64%, rgba(4, 7, 7, 0.16)),
    linear-gradient(0deg, rgba(4, 7, 7, 0.92), transparent 62%),
    var(--detail-image);
  background-position: center;
  box-shadow: var(--shadow);
}

.event-page .detail-hero > div {
  width: min(640px, 100%);
}

.event-page .detail-hero h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0;
  line-height: 1.15;
}

.operator-master-page {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 126px);
}

.operator-master-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5, 8, 8, 0.88), rgba(5, 8, 8, 0.58) 55%, rgba(5, 8, 8, 0.86));
  pointer-events: none;
}

.operator-master-shell {
  width: min(1660px, 100%);
  margin: 0 auto;
  padding-bottom: 42px;
}

.operator-master-toolbar {
  min-height: 74px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.operator-master-toolbar h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0;
}

.operator-master-toolbar .eyebrow {
  margin: 0 0 3px;
}

.operator-master-progress {
  min-width: 82px;
  padding: 7px 10px;
  border: 1px solid rgba(49, 198, 212, 0.34);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.operator-master-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 190px) auto;
  gap: 8px;
  align-items: center;
  margin: 18px 0;
}

.operator-master-controls select {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(12, 16, 15, 0.84);
  color: var(--text);
  font-weight: 750;
}

.operator-master-controls .small-button {
  min-height: 46px;
  white-space: nowrap;
}

.operator-master-controls .small-button.is-active {
  border-color: rgba(49, 198, 212, 0.7);
  background: rgba(49, 198, 212, 0.13);
  color: var(--cyan);
}

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

.operator-master-grid > .empty {
  grid-column: 1 / -1;
}

.operator-master-card {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(190px, 0.78fr) minmax(260px, 1.22fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(10, 14, 13, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.operator-master-card.is-complete {
  border-color: rgba(49, 198, 212, 0.76);
}

.operator-master-art {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(49, 198, 212, 0.08), transparent 42%),
    #080b0a;
}

.operator-master-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(5, 7, 7, 0.96));
  pointer-events: none;
}

.operator-master-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.35));
}

.operator-master-identity {
  position: absolute;
  z-index: 1;
  inset: auto 14px 13px;
  display: grid;
  gap: 3px;
}

.operator-master-identity strong {
  font-size: 20px;
  line-height: 1.15;
}

.operator-master-identity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.operator-master-tasks {
  min-width: 0;
  padding: 13px;
}

.operator-master-tasks > header,
.operator-master-section > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.operator-master-tasks > header {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.operator-master-tasks > header strong {
  color: var(--cyan);
  font-size: 14px;
}

.operator-master-section {
  padding: 10px 0;
  border-bottom: 1px solid rgba(235, 241, 238, 0.1);
}

.operator-master-section:last-child {
  border-bottom: 0;
}

.operator-master-section > header {
  margin-bottom: 6px;
}

.operator-master-section > header strong {
  color: var(--gold);
  font-size: 12px;
}

.operator-master-section > header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.operator-master-task-list {
  display: grid;
  gap: 3px;
}

.operator-master-task {
  min-height: 25px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 3px 0;
  color: var(--text);
  cursor: pointer;
}

.operator-master-task input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.operator-master-check {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
}

.operator-master-task input:checked + .operator-master-check {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: inset 0 0 0 3px rgba(8, 28, 30, 0.88);
}

.operator-master-task > span:last-child {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.42;
}

.operator-master-task.is-complete > span:last-child {
  color: var(--muted-2);
  text-decoration: line-through;
}

.event-page .detail-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: 20px 0 42px;
}

.event-page .task-group,
.event-page .detail-body aside .panel {
  background: rgba(11, 15, 14, 0.88);
  backdrop-filter: blur(9px);
}

.event-page .task-section {
  gap: 18px;
}

.event-categories {
  display: grid;
  gap: 14px;
}

.event-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.event-category-tab {
  min-width: 142px;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 13, 0.78);
  color: var(--muted);
  text-align: left;
}

.event-category-tab strong {
  font-size: 15px;
}

.event-category-tab span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.event-category-tab:hover,
.event-category-tab.is-active {
  border-color: rgba(49, 198, 212, 0.72);
  background: rgba(49, 198, 212, 0.14);
  color: var(--text);
}

.event-category-panel[hidden] {
  display: none;
}

.survival-reference {
  min-height: 286px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(11, 15, 14, 0.88);
  backdrop-filter: blur(9px);
}

.survival-reference h3,
.survival-reference p {
  margin: 0;
}

.survival-reference h3 {
  font-size: 23px;
}

.survival-reference > p:not(.eyebrow) {
  color: var(--muted);
}

.survival-reference-link {
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 18px;
  align-items: center;
  margin-top: 8px;
  padding: 18px 20px;
  border: 1px solid rgba(49, 198, 212, 0.55);
  border-radius: var(--radius-sm);
  background: rgba(49, 198, 212, 0.1);
  color: var(--text);
  text-align: left;
}

.survival-reference-link:hover {
  border-color: var(--cyan);
  background: rgba(49, 198, 212, 0.18);
}

.survival-reference-link span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.survival-reference-link strong {
  grid-column: 1;
  font-size: 20px;
}

.survival-reference-link small {
  grid-column: 1;
  color: var(--muted);
}

.survival-reference-link b {
  grid-column: 2;
  grid-row: 1 / span 3;
  color: var(--cyan);
  font-size: 28px;
}

.heat-sands-progress,
.integrated-operator-gallery {
  display: grid;
  gap: 14px;
  margin: 14px;
  padding: 18px;
  border: 1px solid rgba(49, 198, 212, 0.42);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(49, 198, 212, 0.09), transparent 48%),
    rgba(7, 13, 12, 0.9);
}

.heat-sands-progress-heading,
.heat-sands-goal,
.heat-sands-record-form,
.heat-sands-milestones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.heat-sands-progress-heading h3,
.integrated-operator-gallery h3,
.heat-sands-progress-heading p,
.integrated-operator-gallery p,
.heat-sands-bar-copy {
  margin: 0;
}

.heat-sands-progress-heading > div,
.integrated-operator-gallery-head > div {
  display: grid;
  gap: 5px;
}

.heat-sands-progress-heading > div > p:not(.eyebrow),
.integrated-operator-gallery p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.heat-sands-progress-heading > strong {
  color: var(--cyan);
  font-size: clamp(38px, 5vw, 70px);
  line-height: 0.9;
}

.heat-sands-progress-heading > strong small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 15px;
}

.heat-sands-record-form {
  align-items: end;
  padding-top: 4px;
}

.heat-sands-record-form label {
  min-width: min(100%, 290px);
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.heat-sands-record-form input {
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(1, 7, 6, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
}

.heat-sands-record-form button {
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid var(--cyan);
  border-radius: 2px;
  background: rgba(8, 70, 72, 0.58);
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.heat-sands-record-form button:hover {
  background: rgba(49, 198, 212, 0.28);
}

.heat-sands-goal {
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.heat-sands-goal div {
  display: grid;
  gap: 3px;
}

.heat-sands-goal strong {
  color: var(--gold);
  font-size: 22px;
}

.heat-sands-bar {
  height: 13px;
}

.heat-sands-bar-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.heat-sands-bar-copy strong {
  margin-left: 8px;
  color: var(--cyan);
}

.heat-sands-milestones {
  flex-wrap: wrap;
  justify-content: start;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.heat-sands-milestones > span {
  color: var(--gold);
}

.heat-sands-milestones b {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  padding: 5px 7px;
  border: 1px solid rgba(49, 198, 212, 0.3);
  color: var(--text);
  font-size: 12px;
}

.heat-sands-milestones small {
  color: var(--muted);
  font-size: 10px;
}

.heat-sands-milestones p {
  margin: 0;
}

.integrated-operator-gallery {
  padding: 0;
  overflow: hidden;
}

.integrated-operator-gallery-head {
  padding: 18px 18px 0;
}

.integrated-operator-gallery .task-training-grid {
  padding: 4px 18px 18px;
}

.integrated-theme-progress {
  margin: 14px;
}

.event-page .task-group header {
  min-height: 58px;
  padding: 13px 18px;
}

.event-page .task-group header strong {
  font-size: 17px;
}

.event-page .task-group-summary {
  gap: 12px;
}

.event-page .task-group-summary small {
  font-size: 12px;
}

.event-page .task-tabs {
  min-height: 540px;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
}

.collection-tabs {
  display: grid;
}

.collection-tab-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px 0;
  border-bottom: 1px solid var(--line);
}

.collection-tab {
  min-width: 136px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.collection-tab:hover,
.collection-tab.is-active {
  border-color: rgba(49, 198, 212, 0.58);
  background: rgba(49, 198, 212, 0.11);
  color: var(--text);
}

.collection-tab strong {
  font-size: 15px;
}

.collection-tab span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.collection-tab-panel[hidden] {
  display: none;
}

.collection-other-items {
  padding: 0 14px 14px;
}

.collection-other-items .task-cluster-list {
  padding: 0;
}

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

.task-gallery-grid--relics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.task-gallery-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(11, 16, 15, 0.94);
  cursor: pointer;
  isolation: isolate;
}

.task-gallery-card:hover {
  border-color: rgba(49, 198, 212, 0.72);
}

.task-gallery-card:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.task-gallery-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.task-gallery-art {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  padding: 12px 12px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 52%),
    rgba(1, 5, 4, 0.62);
}

.task-gallery-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.task-gallery-card--relic .task-gallery-art {
  aspect-ratio: 1;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 58%),
    rgba(1, 5, 4, 0.8);
}

.task-gallery-card--relic .task-gallery-copy {
  min-height: 88px;
  padding: 10px 42px 11px 11px;
}

.task-gallery-card--relic .task-gallery-copy strong {
  font-size: 13px;
}

.task-gallery-card--relic .task-gallery-copy small {
  font-size: 10px;
}

.task-gallery-card--relic .task-gallery-detail {
  font-size: 9px;
}

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

.task-training-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(11, 16, 15, 0.94);
}

.task-training-art {
  position: relative;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 54%),
    rgba(1, 5, 4, 0.62);
}

.task-training-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.task-training-identity {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 3px;
  padding: 38px 14px 13px;
  background: linear-gradient(transparent, rgba(5, 9, 8, 0.96) 68%);
}

.task-training-identity strong,
.task-training-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-training-identity strong {
  font-size: 18px;
}

.task-training-identity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.task-training-jump {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(49, 198, 212, 0.58);
  border-radius: 2px;
  background: rgba(4, 16, 16, 0.88);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.task-training-jump:hover {
  background: rgba(49, 198, 212, 0.18);
}

.task-training-jump span {
  color: inherit;
  font-size: 13px;
}

.task-training-art > .mini-count {
  position: absolute;
  top: 12px;
  right: 12px;
}

.cluster-complete-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(49, 198, 212, 0.72);
  border-radius: 50%;
  background: rgba(4, 16, 16, 0.9);
  color: var(--cyan);
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
}

.cluster-complete-button:hover:not(:disabled) {
  background: rgba(49, 198, 212, 0.2);
}

.cluster-complete-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

.task-training-art > .cluster-complete-button {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.task-training-list {
  display: grid;
  padding: 5px 0;
}

.task-gallery-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 52px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(11, 16, 15, 0.94);
}

.task-gallery-copy strong,
.task-gallery-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-gallery-copy strong {
  font-size: 17px;
}

.task-gallery-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.task-gallery-copy .task-gallery-detail {
  color: var(--gold);
  font-size: 10px;
}

.task-gallery-card > .mini-count {
  position: absolute;
  right: 12px;
  bottom: 13px;
  z-index: 1;
}

.task-gallery-check {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(240, 245, 241, 0.86);
  border-radius: 50%;
  background: rgba(4, 10, 9, 0.8);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.task-gallery-check::after {
  width: 11px;
  height: 18px;
  border: solid var(--cyan);
  border-width: 0 3px 3px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg) translate(-1px, -2px);
}

.task-gallery-card.is-complete .task-gallery-check,
.task-gallery-card input:checked ~ .task-gallery-check {
  border-color: var(--cyan);
  background: rgba(12, 62, 63, 0.9);
}

.task-gallery-card.is-complete .task-gallery-check::after,
.task-gallery-card input:checked ~ .task-gallery-check::after {
  opacity: 1;
}

.event-page .task-tab-list {
  gap: 8px;
  padding: 12px;
}

.event-page .task-tab {
  min-height: 86px;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 10px;
}

.event-page .task-tab-text strong,
.event-page .task-cluster-heading strong {
  font-size: 16px;
}

.event-page .task-tab-text small,
.event-page .task-cluster-heading span {
  font-size: 12px;
}

.event-page .task-tab-panels {
  padding: 14px;
}

.event-page .task-cluster-heading {
  position: relative;
  min-height: 494px;
  display: block;
  padding: 22px 72px 18px;
}

.event-page .task-avatar {
  width: 64px;
  height: 64px;
  font-size: 16px;
}

.event-page .task-avatar--feature {
  width: min(390px, calc(100vw - 510px));
  height: min(390px, calc(100vw - 510px));
  min-width: 250px;
  min-height: 250px;
}

.event-page .task-cluster-heading > .mini-count {
  position: absolute;
  top: 14px;
  right: 14px;
}

.event-page .task-panel-identity {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.event-page .task-panel-identity > div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.event-page .task-panel-identity strong,
.event-page .task-panel-identity span {
  max-width: min(100%, 440px);
}

.event-page .task-panel-identity strong {
  font-size: 20px;
}

.event-page .task-feature-artwork {
  position: relative;
  display: grid;
  place-items: center;
}

.event-page .task-tab-panel:has(.task-image-check) .task-cluster-body {
  display: none;
}

.event-page .task-tab.is-text-only {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 14px;
}

.event-page .task-tab-panel.is-text-only .task-cluster-heading {
  min-height: 80px;
  display: grid;
  align-items: center;
  padding: 14px 64px 14px 18px;
}

.event-page .task-tab-panel.is-text-only .task-panel-identity,
.event-page .task-tab-panel.is-text-only .task-panel-identity > div {
  justify-items: start;
  text-align: left;
}

.event-page .task-row {
  padding: 11px 16px;
  font-size: 16px;
}

.event-page .task-row input {
  width: 18px;
  height: 18px;
}

.event-page .detail-body aside {
  order: 2;
}

.event-page .detail-body aside .panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(240px, 1fr) auto;
  gap: 10px 24px;
  align-items: center;
}

.event-page .detail-body aside .panel .eyebrow,
.event-page .detail-body aside .panel h3 {
  grid-column: 1;
  margin: 0;
}

.event-page .detail-body aside .panel > .muted {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}

.event-page .detail-body aside .panel .wide-command {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.event-page .detail-body aside .panel .health-list,
.event-page .detail-body aside .panel > p:last-child {
  grid-column: 1 / -1;
}

.source-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 38px);
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow);
}

.source-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.source-dialog-body {
  padding: 18px;
}

.sync-button.is-synced {
  border-color: rgba(49, 198, 212, 0.66);
  color: var(--cyan);
}

.sync-button.is-syncing {
  color: var(--gold);
}

.sync-dialog {
  width: min(520px, calc(100vw - 32px));
}

.sync-dialog-body {
  display: grid;
  gap: 18px;
}

.sync-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.sync-signed-out,
.sync-signed-in,
.sync-email-field {
  display: grid;
  gap: 10px;
}

.sync-email-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sync-email-field input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
}

.detail-hero {
  min-height: 260px;
  display: grid;
  align-items: end;
  padding: 22px;
  background:
    linear-gradient(0deg, rgba(7, 9, 9, 0.96), rgba(7, 9, 9, 0.22)),
    var(--detail-image);
  background-size: cover;
  background-position: center;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  padding: 16px;
}

.detail-body-simple {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.task-section {
  display: grid;
  gap: 10px;
}

.task-group {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.task-group header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.task-group header strong {
  font-size: 14px;
}

.task-group-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-group-summary small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.integrated-squad-matrix {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.integrated-squad-matrix-heading {
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.integrated-squad-matrix-heading div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.integrated-squad-matrix-heading strong {
  font-size: 15px;
}

.integrated-squad-matrix-heading span:not(.mini-count) {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrated-squad-matrix-scroll {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px;
}

.integrated-squad-matrix-grid {
  min-width: 1030px;
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(var(--matrix-columns), minmax(46px, 0.55fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.integrated-squad-matrix--endings .integrated-squad-matrix-grid {
  min-width: 720px;
  grid-template-columns: minmax(220px, 1.3fr) repeat(var(--matrix-columns), minmax(118px, 1fr));
}

.integrated-squad-matrix-corner,
.integrated-squad-matrix-level,
.integrated-squad-matrix-row-label,
.integrated-squad-matrix-cell {
  min-height: 48px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.integrated-squad-matrix-corner,
.integrated-squad-matrix-level {
  display: grid;
  place-items: center;
  gap: 1px;
  background: rgba(11, 20, 19, 0.88);
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
}

.integrated-squad-matrix-level small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.integrated-squad-matrix-row-label {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.025);
}

.integrated-squad-matrix-row-label strong {
  font-size: 13px;
}

.integrated-squad-matrix-row-label small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrated-squad-matrix-cell {
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(5, 12, 11, 0.5);
}

.integrated-squad-matrix-cell:hover {
  background: rgba(49, 198, 212, 0.12);
}

.integrated-squad-matrix-cell input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.integrated-squad-matrix-cell span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 245, 241, 0.48);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
}

.integrated-squad-matrix--endings .integrated-squad-matrix-cell span {
  width: auto;
  min-width: 40px;
  padding: 0 7px;
  border-radius: 999px;
}

.integrated-squad-matrix-cell.is-complete,
.integrated-squad-matrix-cell:has(input:checked) {
  background: rgba(20, 102, 106, 0.22);
}

.integrated-squad-matrix-cell.is-complete span,
.integrated-squad-matrix-cell input:checked + span {
  border-color: var(--cyan);
  background: rgba(12, 62, 63, 0.92);
  color: var(--cyan);
}

.integrated-squad-matrix-cell input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.task-cluster-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.task-cluster {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.task-cluster summary {
  min-height: 56px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.task-cluster.is-text-only summary {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 12px;
}

.task-cluster summary::-webkit-details-marker {
  display: none;
}

.task-cluster[open] summary {
  border-bottom: 1px solid var(--line);
}

.task-cluster-bulk {
  display: flex;
  justify-content: flex-end;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.task-cluster-title,
.task-tab-text,
.task-cluster-heading div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.task-cluster-title strong,
.task-tab-text strong,
.task-cluster-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-cluster-title small,
.task-tab-text small,
.task-cluster-heading span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-tabs {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.task-tab-list {
  max-height: min(640px, 66vh);
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding: 8px;
  border-right: 1px solid var(--line);
}

.task-tab {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.task-tab:hover,
.task-tab.is-active {
  border-color: rgba(49, 198, 212, 0.52);
  background: rgba(49, 198, 212, 0.12);
}

.task-tab.is-text-only {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 10px;
}

.task-tab-panels {
  min-width: 0;
  padding: 10px;
}

.task-tab-panel {
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.task-tab-panel[hidden] {
  display: none;
}

.task-cluster-heading {
  min-height: 58px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.task-cluster-heading > .cluster-complete-button {
  position: absolute;
  top: 14px;
  right: 58px;
}

.task-cluster-body {
  display: grid;
  padding: 6px 0;
}

.task-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 13px;
  font-weight: 950;
}

.task-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0b1010;
}

.task-feature-artwork .task-avatar {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.task-image-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.task-image-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.task-image-check-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(240, 245, 241, 0.85);
  border-radius: 50%;
  background: rgba(5, 10, 9, 0.72);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.task-image-check-mark::after {
  width: 10px;
  height: 17px;
  border: solid var(--cyan);
  border-width: 0 3px 3px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg) translate(-1px, -2px);
}

.task-image-check input:focus-visible + .task-image-check-mark {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.task-image-check input:checked + .task-image-check-mark {
  border-color: var(--cyan);
  background: rgba(12, 62, 63, 0.88);
}

.task-image-check input:checked + .task-image-check-mark::after {
  opacity: 1;
}

.task-avatar img ~ .task-avatar-fallback {
  display: none;
}

.task-avatar.uses-fallback .task-avatar-fallback {
  display: grid;
}

.mini-count {
  min-width: 42px;
  display: inline-flex;
  justify-content: center;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 950;
}

.task-row {
  padding: 7px 12px;
}

.task-row + .task-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.task-row.is-focus-target {
  background: rgba(49, 198, 212, 0.16);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.task-row label {
  display: flex;
  align-items: start;
  gap: 9px;
  line-height: 1.45;
}

.task-row-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.task-row-copy strong {
  font-size: 13px;
}

.task-row-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.task-row-copy .task-row-condition {
  color: var(--gold);
}

.task-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--cyan);
}

.note-box {
  min-height: 148px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
}

/* Backgrounds are managed as files under assets/backgrounds, not browser-local uploads. */
.simple-topbar .top-actions > .file-command,
.event-page .detail-body aside {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 50;
  min-width: 260px;
  max-width: calc(100vw - 30px);
  transform: translateX(-50%) translateY(22px);
  opacity: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: 0.18s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .event-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operator-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .operator-master-card { grid-template-columns: minmax(165px, 0.72fr) minmax(235px, 1.28fr); }
}

@media (min-width: 1720px) {
  .operator-master-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operator-master-card { grid-template-columns: minmax(155px, 0.74fr) minmax(225px, 1.26fr); }
}

@media (max-width: 980px) {
  .event-page .detail-body {
    grid-template-columns: 1fr;
  }

  .event-page .detail-body aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .event-page .task-tabs {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .event-page .detail-body aside .panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .event-page .detail-body aside .panel .eyebrow,
  .event-page .detail-body aside .panel h3,
  .event-page .detail-body aside .panel > .muted,
  .event-page .detail-body aside .panel .wide-command,
  .event-page .detail-body aside .panel .health-list,
  .event-page .detail-body aside .panel > p:last-child {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 980px) {
  :root {
    --content: min(100vw - 24px, 960px);
  }

  .topbar,
  .dashboard-grid,
  .source-layout,
  .detail-body {
    grid-template-columns: 1fr;
  }

  .simple-topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: start;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    min-width: 128px;
  }

  .event-grid,
  .operator-grid,
  .source-grid,
  .roadmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .next-list--priority {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-row {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  .task-tabs {
    grid-template-columns: 1fr;
  }

  .task-tab-list {
    max-height: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 72vw);
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .task-gallery-grid--relics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .operator-master-grid {
    grid-template-columns: 1fr;
  }

  .operator-master-card {
    grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 640px) {
  .background-stage {
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 3px;
    background: var(--bg);
    filter: brightness(0.96) saturate(1.05);
  }

  .background-stage::after {
    background: rgba(0, 0, 0, 0.08);
  }

  .background-stage-panel {
    display: block;
    min-height: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: background-image 1.2s ease;
  }

  .background-stage-panel--first { background-image: var(--app-background-1); }
  .background-stage-panel--second { background-image: var(--app-background-2); }
  .background-stage-panel--third { background-image: var(--app-background-3); }

  .event-page::before {
    display: none;
  }

  .heat-sands-progress-heading,
  .heat-sands-record-form,
  .heat-sands-goal {
    align-items: stretch;
    flex-direction: column;
  }

  .heat-sands-progress-heading > strong {
    font-size: 52px;
  }

  .heat-sands-record-form label {
    min-width: 0;
  }

  .next-list--priority {
    grid-template-columns: 1fr;
  }

  .task-gallery-grid--relics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    padding-top: 12px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr repeat(3, 46px);
  }

  .search {
    grid-column: 1 / -1;
  }

  .metric-grid,
  .event-grid,
  .operator-grid,
  .source-grid,
  .roadmap-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }

  .task-gallery-grid {
    grid-template-columns: 1fr;
  }

  .task-training-grid {
    grid-template-columns: 1fr;
  }

  .operator-master-toolbar {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .operator-master-progress {
    grid-column: 2;
    justify-self: start;
  }

  .operator-master-controls {
    grid-template-columns: 1fr 1fr;
  }

  .operator-master-search {
    grid-column: 1 / -1;
  }

  .operator-master-card {
    grid-template-columns: 1fr;
  }

  .operator-master-art {
    min-height: 370px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .view-head {
    display: grid;
    align-items: start;
  }

  .control-row {
    justify-content: start;
  }

  select {
    width: 100%;
  }

  .hero,
  .hero-overlay {
    min-height: 320px;
  }

  .hero h2 {
    font-size: 38px;
  }
}
