.study-shell,
.study-detail-shell {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 5.5rem 0 5rem;
}

.study-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr);
  gap: 4rem;
  align-items: end;
  padding: 2.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}
.study-eyebrow,
.study-section-kicker,
.study-aside-label {
  color: #bf5b2b;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.study-eyebrow { margin-bottom: 1rem; }
.study-hero h1 {
  max-width: 760px;
  margin-bottom: 1rem;
  color: var(--text);
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: .98;
}
.study-hero-copy > p:last-child {
  max-width: 680px;
  color: var(--text-sub);
  font-size: 1.05rem;
  line-height: 1.8;
}
.study-hero-aside {
  display: grid;
  gap: .55rem;
  padding: 1.25rem 0 0 1.25rem;
  border-left: 2px solid #bf5b2b;
}
.study-hero-aside strong { color: var(--text); font-size: 1.05rem; }
.study-hero-aside span:last-child { color: var(--text-muted); font-size: .82rem; line-height: 1.55; }

.study-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.35rem 0 1rem;
}
.study-track-switch { display: flex; gap: .4rem; flex-wrap: wrap; }
.study-track-button {
  min-height: 36px;
  padding: .45rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-sub);
  font-size: .78rem;
}
.study-track-button:hover,
.study-track-button.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.study-count { margin: 0; color: var(--text-muted); font-size: .8rem; }
.study-context {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid #4a8b82;
  background: rgba(255,255,255,.62);
}
.study-context p { margin: 0; font-size: .78rem; line-height: 1.5; }
.study-status { color: var(--text-sub); }
.study-source { color: var(--text-muted); text-align: right; }

.reading-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  background: var(--border);
}
.reading-level {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  min-width: 0;
  min-height: 70px;
  padding: .8rem .9rem;
  background: var(--white);
  color: var(--text);
  text-decoration: none;
}
a.reading-level:hover { background: #f4f7f2; }
.reading-level.is-active { background: #e9f1ed; box-shadow: inset 0 -3px 0 #2d7068; }
.reading-level.is-gated { background: #f4f2ec; color: var(--text-muted); cursor: not-allowed; }
.reading-level-number { color: #bf5b2b; font: 700 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.reading-level-copy { display: grid; gap: .2rem; min-width: 0; }
.reading-level-copy strong { overflow-wrap: anywhere; font-size: .82rem; line-height: 1.3; }
.reading-level-copy small { color: var(--text-muted); font-size: .68rem; line-height: 1.35; }
.reading-level-status { color: #2d7068; font-size: .66rem; font-weight: 700; text-align: right; white-space: nowrap; }
.reading-level.is-gated .reading-level-status { color: #9a652f; }
.reading-profile-status {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: -.9rem 0 1.5rem;
  padding: .7rem .9rem;
  border: 1px dashed var(--border-strong);
  background: rgba(255,255,255,.58);
}
.reading-profile-copy { display: grid; gap: .2rem; min-width: 0; }
.reading-profile-copy strong { color: var(--text-sub); font-size: .76rem; }
.reading-profile-copy small { color: var(--text-muted); font-size: .68rem; line-height: 1.35; }
.reading-profile-status .reading-level-status { color: #9a652f; }

.study-grid { display: grid; gap: .9rem; }
.study-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 32px;
  gap: 1.4rem;
  align-items: start;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.study-card:hover { transform: translateY(-2px); border-color: rgba(191,91,43,.38); box-shadow: var(--shadow-lg); }
.study-card-index { color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; line-height: 1.4; overflow-wrap: anywhere; }
.study-card-main { min-width: 0; }
.study-card-tags { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.study-badge,
.study-meta-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .2rem .55rem;
  border: 1px solid;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 650;
  line-height: 1.2;
}
.study-badge-standard { color: #2d7068; border-color: rgba(45,112,104,.3); background: rgba(45,112,104,.08); }
.study-badge-relative { color: #a3562c; border-color: rgba(163,86,44,.3); background: rgba(163,86,44,.08); }
.study-meta-tag { color: var(--text-muted); border-color: var(--border); background: transparent; font-weight: 500; }
.study-card h2 { margin-bottom: .45rem; color: var(--text); font-size: 1.25rem; line-height: 1.3; }
.study-card-main > p { margin: 0; color: var(--text-sub); font-size: .9rem; line-height: 1.65; }
.study-card-limit { margin-top: .7rem !important; color: var(--text-muted) !important; font-size: .76rem !important; }
.study-card-arrow { color: #bf5b2b; font-size: 1.2rem; justify-self: end; }

.study-empty {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 1.3rem;
  align-items: center;
  min-height: 190px;
  padding: 2rem;
  border: 1px dashed rgba(34,34,34,.2);
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(255,255,255,.78), rgba(233,242,238,.68));
}
.study-empty-index { color: #bf5b2b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.25rem; font-weight: 700; }
.study-empty h2 { margin-bottom: .45rem; color: var(--text); font-size: 1.2rem; }
.study-empty p { margin: 0; color: var(--text-sub); font-size: .9rem; line-height: 1.65; }
.study-empty-link { color: #2d7068; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.study-empty-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.study-back-link {
  display: inline-flex;
  margin-bottom: 1.4rem;
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 650;
}
.study-back-link::before { content: '←'; margin-right: .4rem; }
.study-back-link:hover { color: var(--text); }
.study-detail { max-width: 920px; }
.study-detail-header { padding: 2.4rem 0 2rem; border-bottom: 1px solid var(--border); }
.study-detail-header h1 { margin: .8rem 0 1rem; color: var(--text); font-size: clamp(2rem, 4.5vw, 4rem); letter-spacing: -.04em; line-height: 1.05; }
.study-detail-summary { max-width: 720px; margin: 0; color: var(--text-sub); font-size: 1.05rem; line-height: 1.8; }
.study-detail-limit { margin: 1.5rem 0; padding: 1rem 1.1rem; border-left: 3px solid #bf5b2b; background: rgba(191,91,43,.07); }
.study-detail-limit strong { display: block; margin-bottom: .25rem; color: #9a4a27; font-size: .78rem; }
.study-detail-limit p { margin: 0; color: var(--text-sub); font-size: .86rem; line-height: 1.6; }
.study-detail-module-limit { border-left-color: #9a652f; background: rgba(154,101,47,.08); }
.study-detail-module-limit strong { color: #805326; }
.study-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 2rem; border: 1px solid var(--border); background: var(--border); }
.study-detail-section { min-width: 0; padding: 1.4rem; background: var(--white); }
.study-section-kicker { margin-bottom: .8rem; }
.study-detail-section ul { margin: 0; padding-left: 1.1rem; color: var(--text-sub); }
.study-detail-section li { margin-bottom: .7rem; padding-left: .2rem; font-size: .9rem; line-height: 1.65; }
.study-detail-result p:last-child { margin: 0; color: var(--text-sub); line-height: 1.7; }
.study-detail-sources a { color: #2d7068; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.study-detail-loading { color: var(--text-muted); }
.study-empty-detail { margin-top: 1rem; }

@media (max-width: 760px) {
  .study-shell,
  .study-detail-shell { width: min(100% - 2rem, 680px); padding-top: 4rem; }
  .study-hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1rem; }
  .study-hero h1 { font-size: clamp(2.7rem, 14vw, 4.5rem); }
  .study-hero-aside { padding-top: 1rem; padding-left: 1rem; }
  .study-toolbar,
  .study-context { align-items: flex-start; flex-direction: column; }
  .study-source { text-align: left; }
  .study-card { grid-template-columns: 1fr 24px; gap: .7rem; }
  .study-card-index { grid-column: 1 / -1; }
  .study-card-arrow { grid-column: 2; grid-row: 2; }
  .study-empty { grid-template-columns: 1fr; gap: .8rem; }
  .study-empty-link { justify-self: start; }
  .study-detail-grid { grid-template-columns: 1fr; }
  .reading-levels { grid-template-columns: 1fr; }
  .reading-level { min-height: 62px; }
  .reading-profile-status { align-items: flex-start; flex-direction: column; }
}