.smpq-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.smpq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.smpq-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.smpq-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.smpq-brand h2 {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
  line-height: 1.1;
}

.smpq-brand span,
.smpq-meta {
  color: var(--form-ui-text-color);
  font-size: 12px;
}

.smpq-datebar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  gap: 10px;
  align-items: end;
}

.smpq-banner {
  border: 1px solid #f0c36d;
  background: #fff7df;
  color: #7a4a00;
  border-radius: var(--form-ui-radius);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
}

.smpq-notice {
  border: 1px solid #b7d9c8;
  background: #edf9f2;
  color: #166534;
  border-radius: var(--form-ui-radius);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.smpq-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.smpq-rank-card {
  border: 1px solid var(--border);
  border-radius: var(--form-ui-radius);
  background: #fff;
  padding: 14px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smpq-rank-card h3,
.smpq-panel-head h3,
.smpq-summary-card h3 {
  margin: 0;
  color: var(--form-ui-title-color);
  font-size: 16px;
  font-weight: 800;
}

.smpq-rank-value {
  color: var(--primary);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
}

.smpq-score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(159, 176, 197, 0.35);
  font-size: 12px;
}

.smpq-score-line:last-child {
  border-bottom: 0;
}

.smpq-main-grid,
.smpq-summary-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

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

.smpq-summary-grid {
  grid-template-columns: 1.15fr 1fr 1fr;
}

.smpq-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.smpq-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.smpq-form-grid.single {
  grid-template-columns: 1fr;
}

.smpq-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.smpq-checklist-table,
.smpq-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.smpq-checklist-table {
  min-width: 560px;
  table-layout: fixed;
}

.smpq-checklist-table th,
.smpq-checklist-table td,
.smpq-summary-table th,
.smpq-summary-table td {
  border: 1px solid var(--border);
  padding: 8px;
  font-size: 12px;
  vertical-align: middle;
}

.smpq-checklist-table th,
.smpq-summary-table th {
  background: #f0f2f8;
  color: var(--primary);
  font-weight: 800;
  text-align: left;
}

.smpq-checklist-table td:last-child,
.smpq-summary-table td:last-child,
.smpq-summary-table th:last-child {
  text-align: right;
}

.smpq-checklist-table .inline-input {
  min-height: 36px;
  padding: 7px 9px;
}

.smpq-penalty-select {
  visibility: hidden;
}

.smpq-checklist-table tr.is-negative .smpq-penalty-select {
  visibility: visible;
}

.smpq-form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.smpq-total-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--form-ui-radius);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
}

.smpq-score-positive {
  color: #18794e;
  font-weight: 800;
}

.smpq-score-negative {
  color: #b42318;
  font-weight: 800;
}

.smpq-score-muted {
  color: var(--form-ui-text-color);
}

.smpq-empty {
  border: 1px dashed var(--border);
  border-radius: var(--form-ui-radius);
  padding: 14px;
  color: var(--form-ui-text-color);
  font-size: 12px;
}

html[data-theme="dark"] .smpq-rank-card,
html[data-theme="dark"] .smpq-total-pill {
  background: #151a24;
  border-color: var(--border);
}

html[data-theme="dark"] .smpq-checklist-table th,
html[data-theme="dark"] .smpq-summary-table th {
  background: #1b2230;
  color: var(--text);
}

html[data-theme="dark"] .smpq-checklist-table td,
html[data-theme="dark"] .smpq-summary-table td {
  background: #121826;
  color: var(--text);
}

html[data-theme="dark"] .smpq-banner {
  background: #32270c;
  border-color: #8b6f1a;
  color: #f7d36e;
}

html[data-theme="dark"] .smpq-notice {
  background: #0f2d1e;
  border-color: #1f7a4a;
  color: #b8f2ce;
}

@media (max-width: 1400px) {
  .smpq-ranking-grid,
  .smpq-summary-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 1080px) {
  .smpq-main-grid,
  .smpq-ranking-grid,
  .smpq-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .smpq-header,
  .smpq-form-foot {
    align-items: stretch;
  }

  .smpq-datebar,
  .smpq-form-grid {
    grid-template-columns: 1fr;
  }

  .smpq-brand h2 {
    font-size: 20px;
  }
}
