/* Interior del área de estudio. Los colores de grupo y los estados de respuesta
   pertenecen a las fichas y a la práctica, independientemente del tema. */
.study-space :is(.content, .modal) {
  --study-blue: var(--ev-blue, #214bc5);
  --study-navy: var(--ev-navy, #192f6b);
  --study-ink: var(--ev-ink, #142238);
  --study-light: var(--ev-light, #edf4ff);
  --study-line: var(--ev-line, #d5dfec);
  --study-muted: #526175;
  --ink: var(--study-ink);
  --green: var(--study-blue);
  --muted: var(--study-muted);
  --line: var(--study-line);
  color: var(--study-ink);
}

.study-space :is(.content, .modal) :is(h1, h2, h3, .stat strong, .score-circle) {
  font-family: VisuEditorial, "DM Sans", system-ui, sans-serif;
  font-weight: 750;
  letter-spacing: -.035em;
}
.study-space .heading-row h1 {
  font-size: clamp(2rem, 3.5vw, 3.15rem);
  line-height: 1.08;
  overflow-wrap: break-word;
}
.study-space .section-head h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.16; }
.study-space .heading-row .subtitle { line-height: 1.6; font-size: .95rem; }
.study-space .content .eyebrow { color: var(--study-blue); }
.study-space .content .tiny-dot { background: var(--study-blue); }
.study-space :is(.content, .modal) :is(.primary, .secondary) {
  min-height: 44px;
  max-width: 100%;
  border-radius: 8px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
}
.study-space :is(.content, .modal) .primary {
  color: white;
  background: var(--study-blue);
  border-color: var(--study-blue);
}
.study-space :is(.content, .modal) .primary:hover {
  color: white;
  background: #183994;
  border-color: #183994;
}
.study-space :is(.content, .modal) .secondary {
  background: white;
  color: var(--study-blue);
  border-color: var(--study-blue);
}
.study-space :is(.content, .modal) .secondary:hover { background: var(--study-light); }
.study-space .content :is(.ghost, .hero-secondary) { color: var(--study-blue); }
.study-space :is(.content, .modal) :is(button, a, input, select):focus-visible {
  outline: 3px solid #5384ed;
  outline-offset: 3px;
}
.study-space .modular-hero.new-hero {
  background: #f3f7ff;
  border-color: var(--study-line);
  border-radius: 16px;
}
.study-space .modular-hero.new-hero h2 { color: var(--study-ink); line-height: 1.08; }
.study-space .modular-hero.new-hero h2 span,
.study-space .modular-hero .hero-kicker { color: var(--study-blue); }
.study-space .modular-hero.new-hero p,
.study-space .modular-hero .hero-footnote { color: var(--study-muted); }
.study-space .hero-secondary { border-bottom-color: currentColor; }
.study-space .stat,
.study-space :is(.panel, .specimen-card, .exam-card, .exam-reader, .exam-toolbar, .question-layout, .source-item, .exam-home-link) {
  background: white;
  border-color: var(--study-line);
  border-radius: 14px;
}
.study-space .stat:nth-child(n) .stat-icon,
.study-space :is(.daily-symbol, .exam-file-icon, .locked-study > .locked-icon, .history-score) {
  color: var(--study-blue);
  background: var(--study-light);
}
.study-space :is(.stat small, .daily-small, .daily-custom span, .bar-label span:last-child, .category-tile small) {
  color: var(--study-muted);
}
.study-space .category-tile { background: white; border-color: var(--study-line); border-radius: 12px; }
.study-space .category-tile strong { color: var(--cat-ink); }
.study-space .category-tile:hover { background: var(--cat-soft); border-color: var(--cat); }
.study-space .specimen-card { box-shadow: none; }
.study-space .specimen-card:hover { border-color: var(--cat); }
.study-space .card-body > div { min-width: 0; }
.study-space .card-body h3 { line-height: 1.24; }
.study-space :is(.card-body p, .detail-content .latin) {
  color: var(--study-blue);
  font-weight: 650;
  font-style: italic;
  line-height: 1.4;
}
.study-space .card-body p {
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: clamp(.76rem, 1vw, .88rem);
}
.study-space .card-body .circle-arrow {
  color: white;
  background: var(--study-blue);
  border-color: var(--study-blue);
}
.study-space .save-btn { color: var(--study-muted); }
.study-space .save-btn.saved { color: var(--study-blue); background: var(--study-light); }
.study-space .save-btn.saved svg { fill: #214bc51c; }

.study-space :is(.toolbar, .search-wrap, .field select, .option, .mode-option, .exam-select select, .exam-community, .daily-durations button, .daily-days span, .daily-extend input, .daily-layout input:not([type=checkbox]), .answer-input) {
  color: var(--study-ink);
  background: white;
  border-color: var(--study-line);
}
.study-space :is(.search-wrap:focus-within, .answer-input:focus) { border-color: var(--study-blue); }
.study-space :is(.result-line, .result-line select, .search-wrap svg, .toggle-label, .exam-select label) {
  color: var(--study-muted);
}
.study-space :is(.toggle-label, .daily-check) input { accent-color: var(--study-blue); }
.study-space :is(.option.selected, .mode-option.selected, .daily-durations button.selected) {
  background: var(--study-light);
  border-color: var(--study-blue);
  color: var(--study-navy);
}
.study-space .exam-community.selected,
.study-space .daily-days input:checked + span {
  background: var(--study-blue);
  border-color: var(--study-blue);
  color: white;
}
.study-space :is(.daily-days input:focus-visible + span) { outline-color: #5384ed; }
.study-space .mode-option svg,
.study-space .exam-home-link > svg { color: var(--study-blue); }
.study-space :is(.field, .exam-select, .search-wrap, .daily-reminders, .daily-plan) { min-width: 0; }
.study-space .content :is(.daily-home, .exam-intro) {
  background: var(--study-navy);
  color: white;
  border-color: var(--study-navy);
  border-radius: 14px;
}
.study-space :is(.daily-home, .exam-intro) :is(h2, p, .eyebrow, .exam-summary strong, .exam-summary span) { color: white; }
.study-space :is(.daily-home > .daily-symbol, .exam-intro-icon) { background: white; color: var(--study-blue); }
.study-space .daily-home > .primary { color: var(--study-navy); background: white; border-color: white; }
.study-space .daily-home > .primary:hover { background: var(--study-light); color: var(--study-navy); }
.study-space :is(.practice-aside, .daily-explainer, .daily-pause, .info-bar, .exam-reader-bar, .empty, .trial-access-banner, .trial-upgrade) {
  color: var(--study-navy);
  background: var(--study-light);
  border-color: var(--study-line);
}
.study-space .panel.practice-aside { background: var(--study-light); }
.study-space :is(.practice-aside p, .tip-row, .daily-explainer p, .daily-pause p, .daily-summary p, .empty p, .trial-access-banner .trial-dates) {
  color: var(--study-muted);
}
.study-space :is(.practice-aside .huge-icon, .tip-row svg, .daily-explainer svg, .info-bar svg, .empty svg, .exam-empty > svg, .trial-counter, .trial-access-banner .trial-eyebrow) {
  color: var(--study-blue);
}
.study-space :is(.tip-row, .daily-email, .daily-extend, .exam-source, .detail-block) { border-color: var(--study-line); }
.study-space :is(.session-top span, .daily-session-bar > span, .session-credit, .credit, .detail-block, .exam-library-note, .exam-meta, .exam-description, .exam-home-link p, .exam-source, .exam-results-top > span, .exam-reader p, .exam-empty p, .sources-intro, .source-item p) {
  color: var(--study-muted);
}
.study-space :is(.detail-block strong, .daily-session-bar strong, .zoom-note) { color: var(--study-ink); }
.study-space :is(.session-credit a, .credit a, .exam-source a, .exam-reader a, .source-item a) { color: var(--study-blue); }
.study-space :is(.bar-bg, .progress-track) { background: #e2eaf5; }
.study-space .progress-track i { background: var(--study-blue); }
.study-space .score-circle { color: var(--study-blue); border-color: #ccdcf9; }
.study-space .result-item span:not(.status) { color: var(--study-muted); }
.study-space .exam-count, .study-space .exam-badge:not(.external-doc) { background: var(--study-light); color: var(--study-navy); }
.study-space .selected .exam-count { background: white; color: var(--study-blue); }
.study-space .exam-tags span { border-color: var(--study-line); color: var(--study-muted); }
.study-space .locked-study { background: white; border-color: var(--study-line); border-radius: 14px; }
.study-space .modal { background: white; border: 1px solid var(--study-line); }
.study-space .modal-close { color: var(--study-navy); background: white; }
@media (max-width: 700px) {
  .study-space .heading-row h1 { font-size: clamp(1.8rem, 7.4vw, 2.5rem); }
  .study-space .modular-hero.new-hero h2 { font-size: clamp(1.85rem, 7.5vw, 2.6rem); }
  .study-space .section-head { flex-wrap: wrap; row-gap: 8px; }
  .study-space .daily-custom, .study-space .session-top { flex-wrap: wrap; gap: 8px; }
  .study-space .content .answer-input,
  .study-space .content .search-wrap input,
  .study-space .content .field select,
  .study-space .content .daily-layout input:not([type=checkbox]) { font-size: 16px; }
}

.study-space .group-nav { display:flex; flex-wrap:wrap; gap:.45rem; }
.study-space .group-nav .chip { display:inline-flex; align-items:center; gap:.4rem; width:auto; color:#293d56; }
.study-space .group-nav .category-icon { display:block; flex:none; width:18px; height:18px; fill:currentColor; stroke:none; }
.study-space .group-nav .category-icon [fill="black"] { fill:currentColor; }
.study-space .group-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; overflow:visible; }
.study-space .group-toolbar .search-wrap { flex:1 1 15rem; min-width:0; }
.study-space .group-picker { position:relative; max-width:100%; min-width:0; }
.study-space .group-picker select { appearance:none; -webkit-appearance:none; display:block; box-sizing:border-box; width:100%; max-width:18rem; min-height:44px; padding:.55rem 2.5rem .55rem 1rem; border:0; border-radius:9px; background:#214bc5; color:white; font:inherit; font-weight:650; cursor:pointer; text-overflow:ellipsis; }
.study-space .group-picker option { color:#172639; background:white; }
.study-space .group-picker svg { position:absolute; right:.85rem; top:50%; transform:translateY(-50%); width:16px; height:16px; fill:none; stroke:white; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
@media(max-width:600px) {
  .study-space .group-toolbar .search-wrap { flex-basis:100%; }
  .study-space .group-picker { flex:1 1 10rem; }
  .study-space .group-picker select { max-width:none; }
}

.study-space .specimen-card .card-body p,.study-space .detail-content > h2 + p { color:#353b42; }
.demo-bar { display:flex; align-items:center; justify-content:space-between; padding:14px max(16px,5vw); border-bottom:1px solid #ddd; }
.demo-content .grid { grid-auto-rows:1fr; align-items:stretch; }
.demo-content .specimen-card { display:flex; flex-direction:column; }
.demo-content .photo-button { flex:none; }
.demo-content .card-body { flex:1; }
.demo-content .demo-trial .photo-button { background:white; }
.demo-content .demo-trial .photo-button img { display:block; object-fit:contain; }
.demo-content .demo-trial .card-body { flex-direction:column; align-items:flex-start; justify-content:center; gap:3px; padding-block:6px; }
.demo-content .demo-trial h3 { font-size:.8rem; line-height:1.15; margin:0; }
.demo-content .demo-trial .primary { display:inline-flex; align-items:center; min-height:26px; padding:3px 9px; font-size:.75rem; line-height:1.15; text-decoration:none; }

.study-space .detail-figure { margin:0; min-width:0; align-self:start; }
.study-space .detail-figure .detail-photo { min-height:0; }
.study-space .detail-figure .detail-photo img { display:block; height:auto; max-height:48vh; }
.study-space .detail-figure .credit { margin:0; padding:10px 16px; font-size:.75rem; line-height:1.4; }
.study-space .detail-content { padding:30px 22px 16px; }
.study-space .detail-content .detail-block { padding:9px 0; line-height:1.5; }
.study-space .detail-content .detail-actions { margin:10px 0 0; }
@media (max-width:700px) {
  .study-space .detail-figure .detail-photo img { max-height:32vh; }
  .study-space .detail-content { padding:14px 16px; }
}

.study-space .demo-content .heading-row .subtitle {
  color: var(--study-ink);
  font-size: clamp(1.125rem, 1rem + .55vw, 1.375rem);
  font-weight: 750;
  line-height: 1.4;
}

@media (max-width:780px) and (orientation:portrait) {
  .study-space:has(#catalog-demo) .detail { grid-template-columns:minmax(0,1fr); }
  .detail-content .detail-photo-credit { margin:14px 0 0; padding-top:10px; border-top:1px solid var(--study-line); font-size:.75rem; line-height:1.4; }
}

/* Public sample cards link to the existing specimen pages. */
.demo-content .demo-specimen-name {
  display: block;
  color: inherit;
  text-decoration: none;
}
.demo-content .demo-specimen-name:hover h3,
.demo-content .demo-specimen-name:focus-visible h3 {
  text-decoration: underline;
}
.demo-content .card-body button[aria-haspopup="dialog"] {
  display: grid;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}
.demo-content .card-body h3 {
  overflow-wrap: anywhere;
}
.demo-content .photo-button:focus-visible {
  outline: 3px solid var(--study-blue, #214bc5);
  outline-offset: -3px;
  z-index: 1;
}
