/* Estudiar's own styles, scoped under .dg-study (the view's root and the layer its sheets open in). The page that
   hosts it (page/index.html, or Notas' #/estudiar route) provides the tokens (--bg, --ink, --accent...) and the fonts. */
.dg-study { display: block; color: var(--ink); font-family: var(--font-body); }
/* Same tokens as engine/page.html and staging/accounts, so this drops into the app's "Estudiar" sheet unchanged. */
.dg-study button, .dg-study input, .dg-study textarea, .dg-study select { font: inherit; color: inherit; }
.dg-study button { cursor: pointer; }
.dg-study a { color: var(--accent); }
.dg-study :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dg-study .eyebrow { font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dg-study h2 { margin: 0; font: 700 19px/1.2 var(--font-display); }
.dg-study h3 { margin: 0; font: 700 16px/1.25 var(--font-display); }
.dg-study .edu { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.dg-study .screen { display: grid; gap: 14px; animation: dgs-in .2s ease-out; }
@keyframes dgs-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .dg-study .screen, .dg-study .flip .inner { animation: none !important; transition: none !important; }
}
.dg-study .card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.dg-study .step { display: flex; align-items: baseline; gap: 10px; }
.dg-study .step b { font: 700 13px/1 var(--font-mono); color: var(--accent); }
.dg-study .small { font-size: 13px; color: var(--muted); margin: 0; }
.dg-study .lead { margin: 0; color: var(--muted); }
.dg-study .btn { min-height: var(--tap); border-radius: 14px; border: 1px solid var(--line); background: var(--solid); font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; width: 100%; text-decoration: none; color: var(--ink); }
.dg-study .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.dg-study .btn.ghost { background: transparent; }
.dg-study .btn.danger { color: var(--tear); border-color: color-mix(in srgb, var(--tear) 45%, transparent); background: transparent; }
.dg-study .btn:disabled { opacity: 0.45; cursor: default; }
.dg-study .row { display: flex; gap: 8px; flex-wrap: wrap; }
.dg-study .row > .btn { flex: 1 1 140px; width: auto; }
.dg-study .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--accent-soft); }
.dg-study .seg button { min-height: 44px; border: 0; border-radius: 10px; background: none; font-weight: 700; font-size: 14px; color: var(--ink); }
.dg-study .seg.two { grid-template-columns: repeat(2, 1fr); }
.dg-study .seg button[aria-pressed="true"] { background: var(--solid); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.dg-study .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-study .chip { min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--solid); font-weight: 700; font-size: 15px; text-align: left; display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.dg-study .chip small { font-weight: 400; font-size: 12px; color: var(--muted); }
.dg-study .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.dg-study label.field { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.dg-study input[type="date"], .dg-study select, .dg-study textarea { min-height: var(--tap); border-radius: 12px; border: 1px solid var(--line); background: var(--solid); padding: 10px 12px; width: 100%; }
.dg-study textarea { min-height: 180px; resize: vertical; font-size: 15px; line-height: 1.45; }
.dg-study input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.dg-study .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dg-study .days button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--solid); font-weight: 700; font-size: 13px; }
.dg-study .days button[aria-pressed="true"] { background: var(--ink); color: var(--bg-glow); }
/* the AI consent sheet: a bottom sheet on phones, nothing pre-selected, two equal-size buttons */
.dg-study .backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(10, 18, 22, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.dg-study .sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--solid); border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 12px; box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: dgs-up .22s ease-out; }
@keyframes dgs-up { from { transform: translateY(24px); opacity: 0; } }
.dg-study .sheet .points { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.dg-study .aioff { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); font-size: 15px; text-align: center; }
.dg-study .aioff a { color: var(--muted); font-weight: 700; }
.dg-study .switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dg-study .switch { flex: none; width: 60px; height: 36px; border-radius: 18px; border: 0; background: color-mix(in srgb, var(--muted) 35%, transparent); position: relative; }
.dg-study .switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: left .18s; }
.dg-study .switch[aria-checked="true"] { background: var(--accent); }
.dg-study .switch[aria-checked="true"]::after { left: 28px; }
.dg-study details summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.dg-study details ul { margin: 4px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
.dg-study .status { font-size: 14px; color: var(--muted); text-align: center; min-height: 20px; margin: 0; }
.dg-study .status.err { color: var(--tear); font-weight: 700; }
.dg-study .spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: dgs-spin .8s linear infinite; }
@keyframes dgs-spin { to { transform: rotate(360deg); } }
/* results */
.dg-study .countdown { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dg-study .big { font: 700 44px/1 var(--font-display); color: var(--accent); }
.dg-study .pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 700 12px/1.2 var(--font-body); background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.dg-study .pill.warn { background: var(--warn-soft); color: var(--warn); }
.dg-study .pill.muted { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.dg-study .flag { border-left: 5px solid var(--warn); background: var(--warn-soft); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; }
.dg-study .flag q { font-style: italic; }
.dg-study .flag .fix { font-weight: 700; }
.dg-study .fc { perspective: 1200px; }
.dg-study .flip { border: 0; padding: 0; background: none; width: 100%; text-align: left; display: block; }
.dg-study .flip .inner { position: relative; display: grid; transition: transform .45s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.dg-study .flip[aria-pressed="true"] .inner { transform: rotateY(180deg); }
.dg-study .face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-height: 132px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.dg-study .face.back { transform: rotateY(180deg); background: var(--solid); border-color: var(--accent); }
.dg-study .face .q { font: 700 17px/1.35 var(--font-display); }
.dg-study .face .a { font-size: 16px; }
.dg-study .face .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dg-study .face .hint { font-size: 12px; color: var(--muted); margin-top: auto; }
.dg-study .cardfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 4px 0; }
.dg-study .cardfoot a, .dg-study .cardfoot button { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; border: 0; background: none; color: var(--accent); padding: 0 6px; text-decoration: none; }
.dg-study .day { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.dg-study .day.today { border: 2px solid var(--accent); }
.dg-study .day.exam { background: var(--accent-soft); }
.dg-study .dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dg-study .dayhead .d { font: 500 12px/1 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dg-study .task { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: start; font-size: 15px; }
.dg-study .task .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.dg-study .task .mn { font: 500 12px/26px var(--font-mono); color: var(--muted); }
.dg-study .review { display: grid; gap: 12px; }
.dg-study .review .face { min-height: 200px; position: static; transform: none; }
.dg-study .grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dg-study .grades button { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--solid); font-weight: 700; font-size: 14px; display: grid; place-items: center; line-height: 1.1; }
.dg-study .grades button small { font-weight: 400; font-size: 11px; color: var(--muted); }
.dg-study .grades .g1 { color: var(--tear); }
.dg-study .grades .g3 { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.dg-study .grades .g3 small { color: inherit; opacity: .8; }
.dg-study .empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.dg-study .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.dg-study .kv dt { color: var(--muted); }
.dg-study .kv dd { margin: 0; font-weight: 700; }
.dg-study .hello h2 { font-size: clamp(26px, 7vw, 32px); line-height: 1.1; }
/* "Usar mis notas de Durgical": the student's notes as a checklist */
.dg-study .nlist { display: grid; max-height: 46dvh; overflow: auto; border-top: 1px solid var(--line); }
.dg-study .nrow { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; min-height: 52px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dg-study .nrow input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); }
.dg-study .nrow .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---- the study home (mockups/shell p3 phone, d3 desktop) ---- */
/* with the shared shell: its search pill in the header; the shell owns the way to 3D / Notas, and the language on desktop */
/* phones: the shell has no language switch, so ours stays */
/* the shell's desktop rail (76 px) */
.dg-study .backlink { justify-self: start; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.dg-study .home, .dg-study .home .col { display: grid; gap: 14px; align-content: start; }
.dg-study .row2 { display: grid; gap: 14px; }
.dg-study .hero { background: linear-gradient(135deg, #17807a, #0f5f5a); color: #fff; border: 0; }
.dg-study .hero .eyebrow { color: #bfe6e2; }
.dg-study .hero h2 { font-size: clamp(22px, 6vw, 28px); margin: 2px 0 0; color: #fff; }
.dg-study .hero p { margin: 0; color: #d4efec; }
.dg-study .hero .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.dg-study .hero .stat { background: rgba(255,255,255,.12); border-radius: 12px; padding: 8px 10px; }
.dg-study .hero .stat b { display: block; font: 700 18px/1.2 var(--font-display); }
.dg-study .hero .stat span { font-size: 12px; color: #d4efec; }
.dg-study .herobtn { display: none; }
.dg-study .hero .herobtn { background: #fff; color: #0f5f5a; border: 0; }
.dg-study .strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dg-study .strip > div { border-radius: 10px; padding: 7px 4px; background: color-mix(in srgb, var(--muted) 10%, transparent); text-align: center; font-size: 12px; color: var(--muted); overflow: hidden; }
.dg-study .strip > div b { display: block; color: var(--ink); font-size: 12.5px; }
.dg-study .strip > div span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-study .strip > div.on { background: var(--accent-soft); color: var(--accent); }
.dg-study .strip > div.on b { color: var(--accent); }
.dg-study .strip > div.ex { background: var(--warn-soft); color: var(--warn); }
.dg-study .strip > div:nth-child(5) { display: none; }
.dg-study .weak { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-study .weak a { min-height: 40px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--ink); text-decoration: none; font-size: 14px; display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.dg-study .weak a small { color: var(--muted); font-size: 11.5px; }
.dg-study .deckrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.dg-study .deckrow:first-of-type { border-top: 0; }
.dg-study .deckrow .n { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--accent); white-space: nowrap; }
.dg-study .deckrow .n.ok { color: var(--muted); }
.dg-study .bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; margin-top: 4px; width: 140px; max-width: 40vw; }
.dg-study .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.dg-study .gen .nl { display: none; gap: 8px; }
.dg-study .gen .nl div { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.dg-study .gen .nl i { width: 20px; height: 20px; border-radius: 6px; flex: none; border: 2px solid var(--line); }
.dg-study .gen .nl i.on { background: var(--accent); border-color: var(--accent); }
.dg-study .steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.dg-study .steps li::marker { font-weight: 700; color: var(--accent); }
/* just above the shell's tab bar (it includes the safe area) */
@media (min-width: 900px) {
  .dg-study .home { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
  .dg-study .home .col { gap: 20px; }
  .dg-study .row2 { grid-template-columns: 1fr 1fr; gap: 20px; }
  .dg-study .hero { grid-template-columns: 1fr auto; align-items: center; }
  .dg-study .herobtn { display: inline-flex; width: auto; padding: 0 22px; min-height: 52px; }
  .dg-study .strip { grid-template-columns: repeat(5, 1fr); }
  .dg-study .strip > div:nth-child(5) { display: block; }
  .dg-study .gen .nl { display: grid; }
}
.dg-study.ext-action .herobtn { display: none !important; }   /* the host shows the main action on desktop (chrome.actionOnDesktop) */
