/* MS-102 Plataforma de estudio — diseño estilo Apple
   Layout: barra lateral (escritorio) · tab bar inferior (móvil) */

:root {
  --bg: #f5f5f7;
  --bg2: #ffffff;
  --bg3: #f2f2f4;
  --fill: #e8e8ed;
  --txt: #1d1d1f;
  --txt2: #6e6e73;
  --line: rgba(0,0,0,.08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --ok: #34c759;
  --okbg: #eafaf0;
  --bad: #ff3b30;
  --badbg: #ffefee;
  --warn: #ff9500;
  --warnbg: #fff4e5;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.10);
  --radius: 18px;
  --radius-sm: 12px;
  --glass: rgba(255,255,255,.75);
  --sidebar-w: 232px;
}
[data-theme="dark"] {
  --bg: #000000;
  --bg2: #1c1c1e;
  --bg3: #2c2c2e;
  --fill: #3a3a3c;
  --txt: #f5f5f7;
  --txt2: #98989d;
  --line: rgba(255,255,255,.12);
  --accent: #0a84ff;
  --accent-hover: #2492ff;
  --ok: #30d158;
  --okbg: rgba(48,209,88,.14);
  --bad: #ff453a;
  --badbg: rgba(255,69,58,.14);
  --warn: #ff9f0a;
  --warnbg: rgba(255,159,10,.14);
  --shadow: 0 2px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.6);
  --glass: rgba(18,18,20,.78);
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.022em; margin: .4rem 0 1.1rem; }
h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .8rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--txt2); font-size: .88rem; }
[hidden] { display: none !important; }
::selection { background: rgba(0,113,227,.2); }
button { font-family: inherit; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease, box-shadow .18s ease, filter .18s ease; }
button:active { transform: scale(.97); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ==================== SHELL: SIDEBAR + CONTENIDO ==================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.2rem;
  padding: 1.3rem .9rem 1rem;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; padding: 0 .6rem; }
.logo { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.subtitle { font-size: .7rem; color: var(--txt2); }

.mainnav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.navbtn {
  display: flex; align-items: center; gap: .7rem;
  border: none; background: transparent; color: var(--txt2);
  padding: .6rem .8rem; border-radius: var(--radius-sm); cursor: pointer;
  font-size: .94rem; font-weight: 500; letter-spacing: -0.01em; text-align: left;
}
.navbtn .nicon { font-size: 1.05rem; width: 1.4rem; text-align: center; }
.navbtn:hover { color: var(--txt); background: var(--fill); }
.navbtn.active { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(0,113,227,.3); }

.topactions { display: flex; gap: .4rem; justify-content: center; padding-bottom: .2rem; }
.topactions button {
  border: none; background: var(--fill); border-radius: 980px;
  width: 38px; height: 38px; cursor: pointer; font-size: .95rem;
  color: var(--txt); display: grid; place-items: center;
}
.topactions button:hover { filter: brightness(1.06); box-shadow: var(--shadow); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.6rem 2rem 4rem; flex: 1; }

.view { animation: rise .3s cubic-bezier(.2,.7,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ==================== PANELES Y TARJETAS ==================== */
.panel {
  background: var(--bg2); border-radius: var(--radius);
  padding: 1.35rem 1.5rem; margin-bottom: 1.1rem; box-shadow: var(--shadow);
}
.panel.narrow { max-width: 620px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: .9rem; }
.card {
  background: var(--bg2); border-radius: var(--radius);
  padding: 1rem 1.15rem; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card .big { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; }
.card .lbl { font-size: .76rem; color: var(--txt2); margin-top: .1rem; }

/* panel: héroe (preparación + tarjetas) y rejilla */
.dash-hero { display: grid; grid-template-columns: 320px 1fr; gap: 1.1rem; align-items: stretch; margin-bottom: 1.1rem; }
.hero-readiness { margin-bottom: 0; display: flex; flex-direction: column; justify-content: center; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.dash-grid .panel { margin-bottom: 0; }
.dash-grid + .panel { margin-top: 1.1rem; }
@media (max-width: 1100px) { .dash-hero { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

.center-box { text-align: center; padding: 5rem 1rem; color: var(--txt2); }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 1.2rem; border-radius: 50%;
  border: 3px solid var(--fill); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== FORMULARIOS ==================== */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px,1fr)); gap: 1rem; }
.filter-grid label { display: flex; flex-direction: column; gap: .35rem; font-size: .8rem; font-weight: 500; color: var(--txt2); }
.filter-grid label.check { flex-direction: row; align-items: center; gap: .55rem; font-size: .88rem; color: var(--txt); }
select, input[type=number], input[type=search], input[type=text] {
  padding: .6rem .8rem; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--bg3); color: var(--txt); font-size: .95rem; width: 100%;
  font-family: inherit; appearance: none; -webkit-appearance: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2rem;
}
select:focus, input:focus { border-color: var(--accent); background: var(--bg2); box-shadow: 0 0 0 3px rgba(0,113,227,.15); outline: none; }
input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
input[type=radio] { accent-color: var(--accent); }

.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 1.1rem; margin-top: 1.2rem; }
button.primary {
  background: var(--accent); border: none; color: #fff; font-size: .95rem;
  padding: .65rem 1.6rem; border-radius: 980px; cursor: pointer; font-weight: 500;
  letter-spacing: -0.01em;
}
button.primary:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(0,113,227,.35); }
button.secondary {
  background: var(--fill); border: none; color: var(--txt);
  padding: .6rem 1.3rem; border-radius: 980px; cursor: pointer; font-weight: 500; font-size: .92rem;
}
button.secondary:hover { filter: brightness(1.05); }
button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none !important; }

/* ==================== PREGUNTA ==================== */
.qhead { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-bottom: .7rem; }
.qprogress { font-weight: 700; letter-spacing: -0.01em; }
.badge {
  display: inline-flex; align-items: center; font-size: .72rem; font-weight: 500;
  padding: .22rem .7rem; border-radius: 980px;
  background: var(--fill); color: var(--txt2);
}
.badge.domain { background: var(--accent); color: #fff; }
.badge.hard { background: var(--badbg); color: var(--bad); }
.badge.medium { background: var(--warnbg); color: var(--warn); }
.badge.easy { background: var(--okbg); color: var(--ok); }
.qbar { height: 5px; background: var(--fill); border-radius: 3px; margin: .5rem 0 1.2rem; overflow: hidden; }
.qbar > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .35s cubic-bezier(.2,.7,.3,1); }

.scenario {
  background: var(--bg3); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1rem;
  white-space: pre-wrap; font-size: .88rem; max-height: 300px; overflow: auto;
}
.scenario-toggle { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 500; user-select: none; margin-bottom: .7rem; display: inline-block; }
.qtext { white-space: pre-wrap; margin-bottom: 1.1rem; font-size: 1.02rem; line-height: 1.6; }
.qimg { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: .6rem 0; display: block; background: #fff; }
details summary { cursor: pointer; }
details summary:hover { color: var(--txt); }
table.mdtable { border-collapse: separate; border-spacing: 0; margin: .7rem 0; font-size: .9rem; max-width: 100%; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table.mdtable th, table.mdtable td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: .5rem .85rem; text-align: left; }
table.mdtable th { background: var(--bg3); font-weight: 600; }
table.mdtable tr:last-child td { border-bottom: none; }
table.mdtable th:last-child, table.mdtable td:last-child { border-right: none; }

.opts { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.1rem; }
.opt {
  display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem;
  border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--bg2);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.opt input { margin-top: .25rem; flex-shrink: 0; }
.opt.sel { border-color: var(--accent); background: rgba(0,113,227,.06); }
[data-theme="dark"] .opt.sel { background: rgba(10,132,255,.12); }
.opt.correct { border-color: var(--ok); background: var(--okbg); }
.opt.wrong { border-color: var(--bad); background: var(--badbg); }
.optkey { font-weight: 700; min-width: 1.2rem; color: var(--txt2); }
.opt.sel .optkey, .opt:hover .optkey { color: var(--accent); }
.opt.correct .optkey { color: var(--ok); }
.opt.wrong .optkey { color: var(--bad); }

.zone { margin-bottom: 1rem; }
.zone .zlabel { font-size: .93rem; margin-bottom: .35rem; white-space: pre-wrap; }
.zone select { max-width: 560px; }
.zone.correct select { background: var(--okbg); border-color: var(--ok); }
.zone.wrong select { background: var(--badbg); border-color: var(--bad); }
.zone .zfix { font-size: .85rem; color: var(--ok); margin-top: .3rem; font-weight: 500; }

.ordering li { margin-bottom: .45rem; }
.ordering .ordctl { display: flex; gap: .45rem; align-items: center; }
.ordering button { padding: .15rem .6rem; border-radius: 8px; }

.feedback { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 1.1rem 0; font-size: .95rem; }
.feedback.ok { background: var(--okbg); box-shadow: inset 0 0 0 1px var(--ok); }
.feedback.bad { background: var(--badbg); box-shadow: inset 0 0 0 1px var(--bad); }
.explanation { background: var(--bg3); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-top: .9rem; white-space: pre-wrap; font-size: .92rem; line-height: 1.6; }
.refs { margin-top: .7rem; font-size: .88rem; }
.refs a { display: block; word-break: break-all; padding: .1rem 0; }
.qactions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; align-items: center; }
.qactions .spacer { flex: 1; }
.mark-btn { background: var(--fill); border: none; border-radius: 980px; padding: .55rem 1.1rem; cursor: pointer; color: var(--txt); font-size: .88rem; font-weight: 500; }
.mark-btn:hover { filter: brightness(1.05); }
.mark-btn.on { background: var(--warnbg); color: var(--warn); }

/* ==================== ESTADÍSTICAS ==================== */
.statrow { margin-bottom: .8rem; }
.statrow .sr-top { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .3rem; gap: .8rem; }
.sbar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; display: flex; }
.sbar .ok { background: var(--ok); height: 100%; }
.sbar .bad { background: var(--bad); height: 100%; }
.sbar .seen { background: var(--accent); height: 100%; }

.evo-chart { width: 100%; height: 150px; }
.evo-chart polyline { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.evo-chart .axis { stroke: var(--line); stroke-width: 1; }
.evo-chart text { fill: var(--txt2); font-size: 9px; }
.evo-chart circle { fill: var(--accent); }

.readiness { text-align: center; padding: .6rem 0; }
.readiness .pct { font-size: 3.2rem; font-weight: 700; letter-spacing: -0.045em; }
.readiness .verdict { font-size: .92rem; margin-top: .2rem; color: var(--txt2); }

/* ==================== EXAMEN ==================== */
.exam-top {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  position: sticky; top: .8rem; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  padding: .6rem .9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  margin-bottom: .6rem;
}
.timer { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer.warn { color: var(--bad); }
.exam-nav { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 1.1rem; }
.exam-nav button {
  width: 36px; height: 32px; border: none; border-radius: 9px;
  background: var(--fill); cursor: pointer; font-size: .8rem; font-weight: 500; color: var(--txt);
}
.exam-nav button:hover { filter: brightness(1.07); }
.exam-nav button.answered { background: var(--accent); color: #fff; }
.exam-nav button.current { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--warn); }
.result-hero { text-align: center; padding: 2rem 1.4rem; }
.result-hero .score { font-size: 3.6rem; font-weight: 700; letter-spacing: -0.045em; }
.result-hero.pass .score { color: var(--ok); }
.result-hero.fail .score { color: var(--bad); }

.qlist-item { border-bottom: 1px solid var(--line); padding: .8rem .15rem; }
.qlist-item:last-child { border-bottom: none; }
.qlist-item .ql-head { display: flex; gap: .5rem; align-items: center; cursor: pointer; flex-wrap: wrap; }
.qlist-item .ql-head:hover .ql-text { color: var(--accent); }
.qlist-item .ql-text { font-size: .92rem; transition: color .15s ease; }

table.histtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.histtable th, table.histtable td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
table.histtable th { font-weight: 600; color: var(--txt2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

/* ==================== TEMAS / BLOQUES ==================== */
.topic-row { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: none; }
.topic-name { font-size: .95rem; margin-bottom: .6rem; font-weight: 600; letter-spacing: -0.01em; }
.block-grid { display: flex; flex-wrap: wrap; gap: .55rem; }
.blockbtn {
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  min-width: 112px; padding: .7rem .8rem; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg2); color: var(--txt);
  font-size: .85rem; font-weight: 600;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.blockbtn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.blockbtn .bstate { font-size: .7rem; font-weight: 500; color: var(--txt2); }
.blockbtn.passed { background: var(--okbg); border-color: var(--ok); }
.blockbtn.passed .bstate { color: var(--ok); }
.blockbtn.failed { background: var(--badbg); border-color: var(--bad); }
.blockbtn.failed .bstate { color: var(--bad); }
.blockbtn.progress { background: var(--warnbg); border-color: var(--warn); }
.blockbtn.progress .bstate { color: var(--warn); }

.foot { text-align: center; padding: 1.2rem; color: var(--txt2); font-size: .78rem; }

/* ==================== MÓVIL / TABLET: BARRA SUPERIOR + MENÚ DESLIZANTE ==================== */
.topbar { display: none; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 75; }

@media (max-width: 1024px) {
  html { font-size: 15px; }

  /* barra superior con el botón de menú */
  .topbar {
    display: flex; align-items: center; gap: .6rem;
    position: sticky; top: 0; z-index: 60;
    padding: .5rem .8rem; background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: none; border-radius: 10px;
    background: var(--fill); color: var(--txt); cursor: pointer;
  }
  .topbar .nav-toggle .icon { width: 1.35rem; height: 1.35rem; }
  .topbar .tb-title { font-weight: 700; letter-spacing: -0.02em; font-size: 1rem; }

  /* menú lateral fuera de pantalla; entra al abrir */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%;
    width: 250px; max-width: 84vw; z-index: 80;
    transform: translateX(-100%); transition: transform .22s ease;
    flex-direction: column; border-top: none; border-right: 1px solid var(--line);
    overflow-y: auto; padding: 1.1rem .9rem 1rem;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  body.nav-open .nav-backdrop { display: block; }

  .brand { display: flex; }
  .mainnav { flex-direction: column; flex: 0 0 auto; justify-content: flex-start; }
  .navbtn { flex-direction: row; justify-content: flex-start; gap: .7rem; padding: .62rem .8rem; font-size: .95rem; border-radius: var(--radius-sm); }
  .navbtn .nicon { font-size: 1.05rem; width: 1.4rem; }
  .navbtn .nlbl { display: inline; font-size: .95rem; }
  .navbtn.active { background: var(--accent); color: #fff; }
  .navgroup { display: block; }
  .topactions { display: flex; }
  #user-chip:not([hidden]) { display: block; }
  #main { padding: 1rem .9rem 3rem; max-width: 100%; }
}

/* ==================== CHIPS Y CONTROL SEGMENTADO ==================== */
.chipgroup { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .52rem 1.05rem; border-radius: 980px;
  background: var(--bg3); border: 1.5px solid transparent; color: var(--txt);
  font-size: .9rem; font-weight: 500; cursor: pointer; letter-spacing: -0.01em;
}
.chip .icon { width: 1rem; height: 1rem; opacity: .75; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(0,113,227,.3); }
.chip.active .icon { opacity: 1; }

.segmented {
  display: inline-flex; background: var(--bg3); border-radius: 12px; padding: 3px; gap: 2px;
}
.segmented button {
  border: none; background: transparent; padding: .45rem 1.15rem; border-radius: 9px;
  font-size: .88rem; font-weight: 500; color: var(--txt2); cursor: pointer;
}
.segmented button:hover { color: var(--txt); }
.segmented button.active {
  background: var(--bg2); color: var(--txt);
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
[data-theme="dark"] .segmented button.active { background: var(--fill); }

/* ==================== ESTADOS VACÍOS Y STATCARDS ==================== */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; }
.es-icon {
  width: 76px; height: 76px; margin: 0 auto 1.2rem; border-radius: 50%;
  display: grid; place-items: center;
}
.es-icon .icon { width: 38px; height: 38px; }
.es-icon.ok { background: var(--okbg); color: var(--ok); }
.es-icon.bad { background: var(--badbg); color: var(--bad); }
.es-icon.accent { background: rgba(0,113,227,.1); color: var(--accent); }
.es-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: .4rem; }
.es-text { color: var(--txt2); max-width: 420px; margin: 0 auto 1.4rem; font-size: .95rem; }

.statcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; }
.statcard { display: flex; align-items: center; gap: .9rem; }
.statcard .big { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.statcard .lbl { font-size: .78rem; color: var(--txt2); }
.sc-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
}
.sc-icon .icon { width: 22px; height: 22px; }
.sc-icon.ok { background: var(--okbg); color: var(--ok); }
.sc-icon.bad { background: var(--badbg); color: var(--bad); }
.sc-icon.warn { background: var(--warnbg); color: var(--warn); }
.sc-icon.neutral { background: var(--fill); color: var(--txt2); }
.sc-icon.accent { background: rgba(0,113,227,.1); color: var(--accent); }

/* ==================== ICONOS SVG ==================== */
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.22em; flex-shrink: 0; }
.nicon { display: grid; place-items: center; width: 1.5rem; }
.nicon .icon { width: 1.18rem; height: 1.18rem; }
.topactions button .icon { width: 1.05rem; height: 1.05rem; }
button .icon { pointer-events: none; }
.mark-btn .icon, button.secondary .icon { margin-right: .15rem; }

/* grupos de navegación (estilo Ajustes de macOS) */
.navgroup {
  font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--txt2); padding: .9rem .8rem .25rem; user-select: none;
}
.mainnav .navgroup:first-child { padding-top: .2rem; }

/* ==================== ANILLO DE ACTIVIDAD ==================== */
.ring { width: 168px; height: 168px; display: block; margin: 0 auto; }
.ring-bg { fill: none; stroke: var(--fill); stroke-width: 11; }
.ring-fg {
  fill: none; stroke-width: 11; stroke-linecap: round;
  transition: stroke-dashoffset .9s cubic-bezier(.2,.7,.3,1);
}
.ring-num {
  font-size: 26px; font-weight: 700; letter-spacing: -0.03em;
  text-anchor: middle; fill: var(--txt);
}
.ring-cap { font-size: 10px; text-anchor: middle; fill: var(--txt2); }

/* ==================== AFINADO TIPOGRÁFICO ==================== */
h1 { font-size: 2.1rem; margin: .3rem 0 1.3rem; }
h2 {
  font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--txt2); margin: 0 0 1rem;
}
.qtext { font-size: 1.05rem; }
.card .big { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .navgroup { display: none; }
  .nicon { width: auto; }
  h1 { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
