.header-actions,
.filter-controls,
.upload-strip,
.dialog-actions,
.repeater-head,
.range-control,
.color-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-actions {
  justify-content: flex-end;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.icon-button:hover {
  border-color: var(--accent);
}
.icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.summary-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.feedback-banner {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #b8d7c8;
  border-radius: 6px;
  background: #e7f5ee;
  color: var(--ok);
  font-size: 0.875rem;
}
.feedback-banner.error {
  border-color: #efbcbc;
  background: #fff1f1;
  color: #9c1c1c;
}
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.tab-button {
  min-height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.tab-button:hover {
  color: var(--accent);
}
.tab-button.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.table-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.state-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--warn);
}
.state-dot.ok {
  background: var(--ok);
}
.muted {
  color: var(--muted);
}
.empty-state {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
.text-input {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0;
}
textarea.text-input {
  min-height: 76px;
  resize: vertical;
}
.text-input:focus,
.file-input:focus,
.icon-button:focus,
.control-button:focus,
.tab-button:focus {
  outline: 2px solid #8fc4d5;
  outline-offset: 1px;
}
.compact-input {
  width: min(340px, 50vw);
  margin: 0;
}
.compact-check {
  margin: 0;
  white-space: nowrap;
}
.runtime-head {
  align-items: center;
}
.upload-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 0.5fr);
  margin-bottom: 18px;
}
.upload-strip .action-feedback {
  text-align: left;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.asset-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.asset-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
  background: #edf1f2;
  border-bottom: 1px solid var(--line);
}
.asset-meta {
  padding: 10px 12px 12px;
}
.asset-name {
  min-height: 38px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
}
.asset-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}
.asset-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.runtime-value {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 230px;
}
.runtime-value .text-input {
  margin: 0;
}
.runtime-description {
  min-width: 260px;
  color: var(--muted);
  line-height: 1.4;
}
.runtime-catalog-status {
  margin-top: 4px;
  max-width: 760px;
  font-size: 0.78rem;
  line-height: 1.4;
}
.runtime-unit {
  grid-column: 1 / -1;
  font-size: 0.72rem;
}
.component-update-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.5fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.component-update-row:last-child {
  border-bottom: 0;
}
.component-title {
  font-weight: 700;
}
.component-version {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.8125rem;
}
.component-upload {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.component-upload .file-input {
  min-width: 0;
}
.component-row-actions {
  display: flex;
  gap: 6px;
}
.component-feedback {
  grid-column: 2 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.pending-upload-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.pending-upload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.pending-upload-head h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}
.pending-upload-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.pending-upload-feedback {
  grid-column: auto;
  margin-top: 8px;
}
.pending-upload-feedback.error {
  color: #9c1c1c;
}
.pending-upload-path {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.contract-line {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}
.audit-json {
  width: min(640px, 60vw);
  max-height: 280px;
  margin: 8px 0 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f6f7;
  color: var(--text);
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.editor-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(20, 25, 29, 0.24);
}
.editor-dialog::backdrop {
  background: rgba(20, 25, 29, 0.48);
}
.small-dialog {
  width: min(560px, calc(100vw - 32px));
}
.wide-dialog {
  width: min(1180px, calc(100vw - 32px));
}
.dialog-shell {
  display: flex;
  max-height: calc(100vh - 32px);
  flex-direction: column;
}
.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fbfcfc;
}
.dialog-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 1rem;
}
.dialog-body {
  padding: 16px;
  overflow-y: auto;
}
.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}
.dialog-actions .action-feedback {
  margin-right: auto;
  text-align: left;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.form-grid label,
.translation-row label,
.target-item {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}
.form-grid .checkbox-row {
  align-self: end;
  min-height: 38px;
  margin: 0;
  color: var(--text);
}
.wide-field {
  grid-column: span 2;
}
.repeater-head {
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.repeater-head h3 {
  margin: 0;
  font-size: 0.875rem;
  letter-spacing: 0;
}
.translation-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.translation-row {
  display: grid;
  gap: 8px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.announcement-translation-row {
  grid-template-columns: 100px minmax(160px, 0.8fr) minmax(260px, 1.5fr) auto;
}
.main-info-translation-row {
  grid-template-columns: 90px minmax(130px, 0.8fr) minmax(180px, 1fr) minmax(100px, 0.6fr) minmax(180px, 1fr) auto;
}
.translation-row:last-child {
  border-bottom: 0;
}
.target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.target-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.target-item .target-platform-label {
  grid-column: 2;
  color: var(--text);
}
.target-builds {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.target-builds .text-input {
  min-height: 34px;
}
.color-control {
  align-items: stretch;
  margin-top: 6px;
}
.color-control input[type="color"] {
  width: 42px;
  min-height: 38px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  background: #ffffff;
}
.color-control .text-input {
  margin: 0;
}
.range-control {
  min-height: 38px;
  margin-top: 6px;
}
.range-control input {
  min-width: 0;
  flex: 1;
}
.range-control output {
  width: 38px;
  color: var(--text);
  font-size: 0.8125rem;
  text-align: right;
}
.statistics-filter-section,
.statistics-grid,
[data-panel="statistics"] > section + section,
[data-panel="statistics"] > .statistics-grid + section,
[data-panel="statistics"] > section + .statistics-grid {
  margin-top: 16px;
}
.statistics-filter-section {
  margin-top: 0;
}
.statistics-title-row {
  align-items: baseline;
}
.statistics-stamp,
.statistics-period {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.statistics-filter-form {
  display: grid;
  grid-template-columns: minmax(270px, 1.35fr) repeat(4, minmax(125px, 0.75fr)) auto;
  gap: 10px;
  align-items: end;
}
.statistics-filter-form label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}
.statistics-filter-form .text-input {
  min-width: 0;
}
.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  align-self: end;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}
.segmented-control button {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 6px 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
}
.segmented-control button:last-child {
  border-right: 0;
}
.segmented-control button:hover,
.segmented-control button.active {
  background: var(--panel-soft);
  color: var(--accent);
}
.segmented-control button:focus {
  position: relative;
  outline: 2px solid #8fc4d5;
  outline-offset: -2px;
}
.statistics-apply {
  min-height: 38px;
}
.statistics-feedback {
  margin-top: 8px;
  text-align: left;
}
.statistics-growth-privacy {
  margin: 0 18px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.statistics-growth-status {
  margin: 0 18px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.statistics-growth-status.error {
  color: var(--danger);
}
.statistics-growth-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}
.statistics-growth-kpi {
  min-width: 0;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.statistics-growth-wide-empty {
  grid-column: 1 / -1;
}
.statistics-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.statistics-explanation {
  margin: 0 18px 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 90%, var(--accent) 10%);
  font-size: 0.82rem;
  line-height: 1.45;
}
.statistics-explanation.empty-period {
  border-color: color-mix(in srgb, var(--line) 65%, #b27a24 35%);
}
.statistics-kpi {
  min-width: 0;
  min-height: 118px;
  padding: 4px 18px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.statistics-kpi:nth-child(3n) {
  border-right: 0;
}
.statistics-kpi:nth-last-child(-n + 3) {
  border-bottom: 0;
}
.statistics-kpi-label,
.live-metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}
.statistics-kpi-value {
  margin-top: 7px;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.15;
}
.statistics-delta {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
}
.statistics-delta.increase {
  color: var(--accent);
}
.statistics-delta.decrease,
.statistics-delta.neutral,
.statistics-kpi-detail,
.live-metric-detail {
  color: var(--muted);
}
.statistics-kpi-detail {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
  line-height: 1.35;
}
.live-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.live-metric {
  min-width: 0;
  min-height: 92px;
  padding: 4px 12px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.live-metric:nth-child(3n) {
  border-right: 0;
}
.live-metric:nth-last-child(-n + 3) {
  border-bottom: 0;
}
.live-metric-value {
  margin-top: 7px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}
.live-metric-detail {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  line-height: 1.35;
}
.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chart-legend i {
  display: inline-block;
  width: 12px;
  height: 4px;
  border-radius: 2px;
}
.legend-started,
.chart-bar-started {
  fill: #0f5f7a;
  background: #0f5f7a;
}
.legend-completed,
.chart-bar-completed {
  fill: #18855b;
  background: #18855b;
}
.legend-players {
  background: #a43c5a;
}
.statistics-chart-shell {
  min-height: 320px;
  padding: 8px 12px 12px;
}
.statistics-chart-scroll {
  width: 100%;
  overflow-x: auto;
}
.statistics-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  aspect-ratio: 980 / 300;
}
.chart-grid-line {
  stroke: #d8e0e4;
  stroke-width: 1;
}
.chart-axis-label {
  fill: #60707c;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0;
}
.chart-player-line {
  fill: none;
  stroke: #a43c5a;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}
.chart-player-point {
  fill: #ffffff;
  stroke: #a43c5a;
  stroke-width: 2;
}
.statistics-wide-empty {
  grid-column: 1 / -1;
}
[data-panel="statistics"][aria-busy="true"] .statistics-chart,
[data-panel="statistics"][aria-busy="true"] .statistics-kpis,
[data-panel="statistics"][aria-busy="true"] .statistics-grid {
  opacity: 0.68;
}
@media (max-width: 1100px) {
  .summary-four,
  .form-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .component-update-row {
    grid-template-columns: minmax(130px, 0.7fr) minmax(220px, 1.3fr) auto;
  }
  .component-row-actions {
    grid-column: 2 / -1;
  }
  .main-info-translation-row {
    grid-template-columns: 90px repeat(2, minmax(150px, 1fr)) auto;
  }
  .translation-url-label {
    grid-column: 2 / span 2;
  }
  .target-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .statistics-filter-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .statistics-growth-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .segmented-control {
    grid-column: span 2;
  }
  .statistics-apply {
    align-self: end;
  }
}
@media (max-width: 760px) {
  .wrap {
    width: min(100% - 20px, 1440px);
  }
  .topbar,
  .runtime-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .summary-four,
  .grid-two,
  .form-grid,
  .form-grid-four,
  .target-grid {
    grid-template-columns: 1fr;
  }
  .wide-field {
    grid-column: auto;
  }
  .filter-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .compact-input {
    width: 100%;
  }
  .upload-strip {
    grid-template-columns: 1fr;
  }
  .component-update-row {
    grid-template-columns: 1fr;
  }
  .pending-upload-head {
    align-items: stretch;
    flex-direction: column;
  }
  .pending-upload-form {
    grid-template-columns: 1fr;
  }
  .component-row-actions,
  .component-feedback {
    grid-column: auto;
  }
  .component-upload,
  .announcement-translation-row,
  .main-info-translation-row {
    grid-template-columns: 1fr;
  }
  .translation-url-label {
    grid-column: auto;
  }
  .translation-row .remove-translation {
    justify-self: end;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
  .dialog-actions .action-feedback {
    width: 100%;
  }
  .statistics-title-row {
    align-items: flex-start;
  }
  .statistics-filter-form,
  .statistics-kpis,
  .statistics-growth-kpis,
  .live-metrics {
    grid-template-columns: 1fr;
  }
  .segmented-control {
    grid-column: auto;
  }
  .statistics-kpi,
  .statistics-kpi:nth-child(3n),
  .statistics-kpi:nth-last-child(-n + 3),
  .live-metric,
  .live-metric:nth-child(3n),
  .live-metric:nth-last-child(-n + 3) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .statistics-kpi:last-child,
  .live-metric:last-child {
    border-bottom: 0;
  }
  .chart-legend {
    width: 100%;
  }
}
