/* 志望校別対策（school-packs） */

.school-packs-view,
.school-detail-view {
  width: 100%;
  min-width: 0;
}

.school-packs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
}

.school-packs-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #312e81;
  margin: 0;
}

.school-packs-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #4338ca;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.school-packs-back:hover {
  background: #eef2ff;
}

.school-gate-banner {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 1rem;
  border: 2px solid #fcd34d;
  background: #fffbeb;
}

.school-gate-banner--ok {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

.school-gate-banner h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #92400e;
  margin: 0 0 6px;
}

.school-gate-banner--ok h3 {
  color: #047857;
}

.school-gate-banner p {
  font-size: 0.82rem;
  color: #78350f;
  margin: 0 0 10px;
  line-height: 1.55;
}

.school-gate-banner--ok p {
  color: #065f46;
}

.school-gate-banner--trial {
  border-color: #a5b4fc;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}

.school-gate-banner--trial h3 {
  color: #4338ca;
}

.school-gate-banner--trial p {
  color: #4c1d95;
}

.school-gate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.school-gate-cta:hover {
  background: #1d4ed8;
}

.school-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0.5rem 0 0.65rem;
}

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

@media (max-width: 520px) {
  .school-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.school-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-height: 118px;
}

.school-card--buyable {
  border-color: #a5b4fc;
  background: #fafaff;
}

.school-card--owned {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

.school-card--locked,
.school-card--soon {
  border-style: dashed;
  background: #f8fafc;
  opacity: 0.92;
}

.school-card--soon {
  opacity: 0.72;
}

.school-card__name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
}

.school-card__sub {
  font-size: 0.68rem;
  color: #64748b;
}

.school-card__price {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4f46e5;
}

.school-card__badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.school-card--owned .school-card__badge {
  background: #d1fae5;
  color: #047857;
}

.school-card__lock {
  font-size: 1.1rem;
  line-height: 1;
}

.school-card__progress {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.school-card__progress > span {
  display: block;
  height: 100%;
  background: #4f46e5;
}

.school-card__btn {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.school-card__btn--primary {
  background: #4f46e5;
  border-color: #4338ca;
  color: #fff;
}

.school-card__btn--success {
  background: #059669;
  border-color: #047857;
  color: #fff;
}

.school-card__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.school-grid-note {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 8px;
  text-align: center;
}

/* 理科系志望校 */
.school-card--sci.school-card--buyable {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.school-card--sci .school-card__price {
  color: #059669;
}

.school-card--sci.school-card--owned {
  border-color: #34d399;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}

.school-card--sci .school-card__progress > span {
  background: #10b981;
}

.school-section-label--sci {
  color: #047857;
}

.school-gate-banner--sci {
  border-color: #6ee7b7;
  background: #f0fdf4;
}

.school-gate-banner--sci h3 {
  color: #065f46;
}

.school-gate-banner--sci p {
  color: #047857;
}

.school-gate-banner--sci.school-gate-banner--ok {
  border-color: #34d399;
  background: #ecfdf5;
}

.school-detail-hero--sci {
  background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
  border-color: #6ee7b7;
}

.school-detail-hero--sci h2 {
  color: #065f46;
}

.school-detail-view--sci .school-theme-item--active {
  border-color: #34d399;
  background: #ecfdf5;
}

.school-detail-view--sci .school-theme-item--active .school-theme-item__num {
  background: #059669;
  color: #fff;
}

.school-theme-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
}

.school-theme-domain-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.school-theme-sim-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #0d9488;
}

.school-grid--sci {
  margin-bottom: 1rem;
}

/* ホーム入口カード */
.school-home-entry {
  grid-column: 1 / -1;
  border: 2px solid #a5b4fc;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #fff 58%);
  margin-bottom: 4px;
}

.school-home-entry h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #3730a3;
  margin: 0 0 6px;
}

.school-home-entry p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.55;
}

.school-home-entry__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.school-home-entry__btn:hover {
  background: #4338ca;
}

/* 校別詳細 */
.school-detail-hero {
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  margin-bottom: 1rem;
}

.school-detail-hero h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #312e81;
  margin: 0 0 6px;
}

.school-detail-hero p {
  font-size: 0.84rem;
  color: #475569;
  margin: 0;
  line-height: 1.6;
}

.school-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: #64748b;
}

.school-theme-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.school-theme-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.school-theme-item--done {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

.school-theme-item--active {
  border-color: #a5b4fc;
  background: #eef2ff;
}

.school-theme-item--locked {
  opacity: 0.7;
  border-style: dashed;
}

.school-theme-item--interactive {
  cursor: default;
}

.school-theme-item__body--tappable {
  cursor: pointer;
  border-radius: 8px;
  margin: -4px;
  padding: 4px;
  transition: background 0.15s ease;
}

.school-theme-item__body--tappable:hover {
  background: rgba(99, 102, 241, 0.06);
}

.school-theme-item__body--tappable:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

.school-theme-item__tap-hint {
  display: inline-flex;
  margin-top: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #6366f1;
}

.school-theme-modes--preview {
  gap: 4px;
}

.school-theme-mode-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  text-align: center;
}

.school-theme-mode-label__name {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
}

.school-theme-mode-label__note {
  font-size: 0.58rem;
  font-weight: 700;
  color: #94a3b8;
}

.school-theme-mode-label--wakaru {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.school-theme-mode-label--oboeru {
  border-color: #fbcfe8;
  background: #fff7fb;
}

.school-theme-item__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.school-theme-item--done .school-theme-item__num {
  background: #d1fae5;
  color: #047857;
}

.school-theme-item--active .school-theme-item__num {
  background: #4f46e5;
  color: #fff;
}

.school-theme-item__body {
  flex: 1;
  min-width: 0;
}

.school-theme-item__body strong {
  display: block;
  font-size: 0.88rem;
  color: #1e293b;
}

.school-theme-item__title-row strong {
  display: block;
  font-size: 0.88rem;
  color: #1e293b;
}

.school-theme-item__body span {
  font-size: 0.72rem;
  color: #64748b;
}

.school-theme-modes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 5.75rem;
}

.school-theme-modes--single {
  min-width: 5.5rem;
}

.school-theme-mode-action {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.22rem;
}

.school-theme-mode-score {
  font-size: 0.68rem;
  line-height: 1.1;
  text-align: center;
  color: #475569;
  font-weight: 600;
  min-height: 0.8rem;
}

.school-theme-modes--locked,
.school-theme-modes--empty {
  font-size: 0.68rem;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
}

.school-theme-mode-btn {
  min-height: 34px;
  padding: 0 0.55rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.school-theme-mode-btn--wakaru {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.school-theme-mode-btn--oboeru {
  border-color: #f9a8d4;
  color: #be185d;
  background: #fdf2f8;
}

.school-theme-mode-btn--trial.school-theme-mode-btn--wakaru {
  border-color: #818cf8;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.school-theme-mode-btn.progress-indicator {
  position: relative;
  padding-left: 1.35rem;
  color: #fff;
}

.school-theme-mode-btn.progress-indicator::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  transform: translateY(-50%);
  box-sizing: border-box;
}

.school-theme-mode-btn--wakaru.progress-not-started {
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
  border-color: #0ea5e9;
  color: #fff;
}

.school-theme-mode-btn--wakaru.progress-not-started::before {
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: transparent;
}

.school-theme-mode-btn--wakaru.progress-in-progress {
  background: linear-gradient(90deg, #7dd3fc 0 50%, #2563eb 50% 100%);
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.school-theme-mode-btn--wakaru.progress-in-progress::before {
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: conic-gradient(#facc15 0 55%, rgba(255, 255, 255, 0.2) 55% 100%);
}

.school-theme-mode-btn--wakaru.progress-completed {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #fff;
}

.school-theme-mode-btn--wakaru.progress-completed::before {
  background: #22c55e;
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.school-theme-mode-btn--oboeru.progress-not-started {
  background: linear-gradient(135deg, #f9a8d4, #ec4899);
  border-color: #db2777;
  color: #fff;
}

.school-theme-mode-btn--oboeru.progress-not-started::before {
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: transparent;
}

.school-theme-mode-btn--oboeru.progress-in-progress {
  background: linear-gradient(90deg, #f9a8d4 0 50%, #db2777 50% 100%);
  border-color: #be185d;
  color: #fff;
}

.school-theme-mode-btn--oboeru.progress-in-progress::before {
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: conic-gradient(#facc15 0 55%, rgba(255, 255, 255, 0.2) 55% 100%);
}

.school-theme-mode-btn--oboeru.progress-completed {
  background: linear-gradient(135deg, #db2777, #be185d);
  border-color: #9d174d;
  color: #fff;
}

.school-theme-mode-btn--oboeru.progress-completed::before {
  background: #22c55e;
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.school-theme-mode-btn.all-correct {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.school-theme-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (min-width: 480px) {
  .school-theme-modes {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    min-width: 11.5rem;
  }
}

.school-theme-item--next {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.school-theme-item--trial {
  border-color: #a5b4fc;
  background: linear-gradient(135deg, #fafaff, #f5f3ff);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.school-theme-item--trial.school-theme-item--active {
  border-color: #818cf8;
}

.school-theme-item__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.school-theme-item__title-row strong {
  flex: 1;
  min-width: 0;
}

.school-theme-status {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.3;
}

.school-theme-status--done {
  background: #d1fae5;
  color: #047857;
}

.school-theme-status--progress {
  background: #fef3c7;
  color: #b45309;
}

.school-theme-status--trial {
  background: #ede9fe;
  color: #5b21b6;
}

.school-theme-item--done .school-theme-item__num {
  background: #d1fae5;
  color: #047857;
  font-size: 0.82rem;
}

.school-detail-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.school-detail-cta .school-gate-cta {
  width: 100%;
}

.school-detail-cta .school-btn-secondary {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.school-detail-footnote {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 12px;
  line-height: 1.5;
}

/* 購入モーダル内アドオン欄 */
.school-purchase-addon {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.school-purchase-addon h3 {
  display: none;
}

.school-purchase-addon > p:not(.school-purchase-addon__lead) {
  display: none;
}

.school-purchase-addon .school-purchase-addon__grid {
  margin-top: 12px;
}

.school-purchase-addon--locked .school-purchase-addon__grid {
  opacity: 0.55;
}

.school-purchase-addon--locked .school-purchase-addon__grid [data-action="school-buy-g6"],
.school-purchase-addon--locked .school-gate-banner [data-action="school-buy-g6"] {
  pointer-events: auto;
}

.school-home-entry--owned {
  border-color: #6ee7b7;
  background: linear-gradient(135deg, #ecfdf5 0%, #fff 58%);
}

.school-home-entry--owned h3 {
  color: #047857;
}

.school-grade-home-empty {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed #c7d2fe;
  background: #f8fafc;
}

.school-grade-home-empty__title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #312e81;
}

.school-grade-home-empty__steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.55;
}

.school-grade-home-empty__steps li + li {
  margin-top: 0.35rem;
}

.school-grade-onboarding {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}

.school-grade-onboarding__text {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #4338ca;
}

.school-grade-onboarding__dismiss {
  min-height: 32px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.school-grade-onboarding__dismiss:hover {
  background: #4338ca;
}

.school-grade-home-nav {
  margin-bottom: 0.65rem;
}

.school-grade-home-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.school-grade-home-back:hover {
  border-color: #94a3b8;
  color: #1e293b;
  background: #f8fafc;
}

#schoolPacksModal:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.school-packs-view--modal,
.school-detail-view--modal {
  padding-top: 0;
}

.school-packs-header--modal {
  margin-bottom: 0.75rem;
}

.school-packs-header--modal .school-packs-back {
  border: 0;
  background: transparent;
  padding-left: 0;
}

.school-packs-view--modal .school-grid-note {
  margin-bottom: 0;
}

/* ゲートモーダル */
#schoolGateModal:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#schoolGateModal .school-gate-modal-inner {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

#schoolGateModal .school-gate-modal-inner h3 {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 10px;
  color: #1e293b;
}

#schoolGateModal .school-gate-modal-inner p {
  font-size: 0.84rem;
  color: #64748b;
  text-align: center;
  line-height: 1.6;
  margin: 0 0 14px;
}

#schoolGateModal .school-gate-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
