.termo-auth-trigger,
.termo-points-trigger{
  appearance:none;
  -webkit-appearance:none;
  min-height:40px;
  padding:9px 14px;
  border:1px solid rgba(0, 75, 135, 0.18);
  border-radius:999px;
  background:#FFFFFF;
  color:#004B87;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:"Inter",sans-serif;
  font-size:.84rem;
  font-weight:800;
  cursor:pointer;
  box-shadow:none;
  white-space:nowrap;
  max-width:min(100%, 260px);
  overflow:hidden;
}

.termo-points-trigger{
  border-color:rgba(31, 138, 76, 0.24);
  background:#F5FFF8;
  color:#166534;
  text-decoration:none;
}

.termo-points-trigger.has-points{
  border-color:rgba(31, 138, 76, 0.34);
  background:#ECFDF3;
}

.termo-points-trigger:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15, 23, 42, 0.08);
}

.termo-auth-trigger span,
.termo-points-trigger span,
.termo-book-trigger span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.termo-auth-trigger .auth-avatar{
  width:1.45rem;
  height:1.45rem;
  border-radius:999px;
  object-fit:cover;
  border:1px solid rgba(0, 75, 135, 0.14);
}

.termo-auth-trigger--compact{
  width:48px;
  min-width:48px;
  min-height:48px;
  padding:0;
  font-size:1.08rem;
  border-color:#C7D8F3;
  background:#FFFFFF;
}

.termo-auth-trigger--compact .auth-avatar{
  width:2rem;
  height:2rem;
}

.termo-auth-trigger--compact .termo-auth-trigger__label{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}

.termo-book-trigger{
  appearance:none;
  -webkit-appearance:none;
  min-height:40px;
  padding:9px 14px;
  border:1px solid rgba(143, 47, 47, 0.22);
  border-radius:999px;
  background:#FFF7F5;
  color:#8F2F2F;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:"Inter",sans-serif;
  font-size:.84rem;
  font-weight:800;
  cursor:pointer;
  box-shadow:none;
  white-space:nowrap;
  flex:0 0 auto;
  max-width:min(100%, 180px);
  overflow:hidden;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, opacity .18s ease;
}

.termo-book-trigger:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15, 23, 42, 0.08);
}

.termo-book-trigger:disabled{
  opacity:.72;
  cursor:wait;
  transform:none;
  box-shadow:none;
}

.termo-book-notice-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(17, 24, 39, 0.52);
  backdrop-filter:blur(6px);
  z-index:1210;
}

.termo-book-notice-overlay.is-open{
  display:flex;
}

.termo-book-notice-modal{
  width:min(100%, 560px);
  background:#FFFFFF;
  border:1px solid rgba(143, 47, 47, 0.14);
  border-radius:20px;
  box-shadow:0 22px 56px rgba(15, 23, 42, 0.18);
  overflow:hidden;
}

.termo-book-notice-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:22px 22px 0;
}

.termo-book-notice-kicker{
  color:#8F2F2F;
  font-family:"Inter",sans-serif;
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:8px;
}

.termo-book-notice-title{
  color:#123A63;
  font-family:"Inter",sans-serif;
  font-size:clamp(1.25rem, 2.7vw, 1.75rem);
  line-height:1.08;
  font-weight:800;
}

.termo-book-notice-close{
  appearance:none;
  -webkit-appearance:none;
  width:38px;
  height:38px;
  border:1px solid rgba(15, 23, 42, 0.10);
  border-radius:999px;
  background:#FFFFFF;
  color:#5B6777;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex:0 0 auto;
}

.termo-book-notice-body{
  padding:18px 22px 4px;
  color:#2B3A4B;
  font-family:"Lora",Georgia,serif;
  font-size:1rem;
  line-height:1.65;
}

.termo-book-notice-body p{
  margin:0 0 12px;
}

.termo-book-notice-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:18px 22px 22px;
  flex-wrap:wrap;
}

.termo-book-notice-primary,
.termo-book-notice-secondary{
  appearance:none;
  -webkit-appearance:none;
  min-height:42px;
  border-radius:999px;
  padding:10px 16px;
  font-family:"Inter",sans-serif;
  font-size:.9rem;
  font-weight:800;
  cursor:pointer;
}

.termo-book-notice-primary{
  border:1px solid #8F2F2F;
  background:#8F2F2F;
  color:#FFFFFF;
}

.termo-book-notice-secondary{
  border:1px solid rgba(143, 47, 47, 0.20);
  background:#FFF7F5;
  color:#8F2F2F;
}

.termo-favorite-trigger{
  appearance:none;
  -webkit-appearance:none;
  min-height:40px;
  min-width:40px;
  width:40px;
  padding:0;
  border:1px solid rgba(0, 75, 135, 0.18);
  border-radius:999px;
  background:#FFFFFF;
  color:#7A8CA3;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
  cursor:pointer;
  box-shadow:none;
  transition:transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease, background-color .18s ease, opacity .18s ease;
  flex:0 0 auto;
}

.termo-favorite-trigger:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15, 23, 42, 0.08);
}

.termo-favorite-trigger.is-active{
  color:#B45309;
  border-color:rgba(180, 83, 9, 0.24);
  background:#FFF7E8;
}

.termo-favorite-trigger:disabled{
  opacity:.72;
  cursor:wait;
  transform:none;
  box-shadow:none;
}

.termo-study-marker-trigger{
  appearance:none;
  -webkit-appearance:none;
  min-height:40px;
  padding:9px 14px;
  border:1px solid rgba(0, 90, 156, 0.28);
  border-radius:999px;
  background:#EAF2FD;
  color:#005A9C;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:"Inter",sans-serif;
  font-size:.84rem;
  font-weight:800;
  cursor:pointer;
  box-shadow:none;
  white-space:nowrap;
  flex:0 0 auto;
  max-width:min(100%, 250px);
  overflow:hidden;
  transition:transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease, background-color .18s ease, opacity .18s ease;
}

.termo-study-marker-trigger:hover{
  transform:translateY(-1px);
  border-color:rgba(0, 90, 156, 0.40);
  background:#DCEBFC;
  box-shadow:0 10px 18px rgba(15, 23, 42, 0.08);
}

.termo-study-marker-trigger span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.termo-study-marker-trigger.is-marked{
  border-color:rgba(31, 138, 76, 0.36);
  background:#DCFCE7;
  color:#166534;
}

.termo-study-marker-trigger.is-marked:hover{
  border-color:rgba(31, 138, 76, 0.46);
  background:#BBF7D0;
}

.termo-study-marker-trigger[data-termo-study-marker-status="saving"]{
  border-color:rgba(217, 119, 6, 0.32);
  background:#FFF7ED;
  color:#9A3412;
}

.termo-study-marker-trigger.is-error{
  border-color:rgba(143, 47, 47, 0.24);
  background:#FFF7F5;
  color:#8F2F2F;
}

.termo-study-marker-trigger:disabled{
  opacity:.72;
  cursor:wait;
  transform:none;
  box-shadow:none;
}

.termo-auth-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(17, 24, 39, 0.52);
  backdrop-filter:blur(6px);
  z-index:1200;
}

.termo-auth-overlay.is-open{
  display:flex;
}

.termo-auth-modal{
  width:min(100%, 500px);
  max-height:min(88vh, 680px);
  background:#FFFFFF;
  border:1px solid rgba(0, 75, 135, 0.10);
  border-radius:22px;
  box-shadow:0 22px 56px rgba(15, 23, 42, 0.18);
  overflow:auto;
}

.termo-auth-modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:20px 20px 0;
}

.termo-auth-kicker{
  color:#0B5EA8;
  font-family:"Inter",sans-serif;
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:8px;
}

.termo-auth-title{
  color:#123A63;
  font-family:"Inter",sans-serif;
  font-size:clamp(1.25rem, 2.7vw, 1.75rem);
  line-height:1.08;
  font-weight:800;
}

.termo-auth-close{
  appearance:none;
  -webkit-appearance:none;
  width:42px;
  height:42px;
  border:1px solid rgba(0, 75, 135, 0.12);
  border-radius:999px;
  background:#F8FBFF;
  color:#0B5EA8;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex:0 0 auto;
}

.termo-auth-body{
  padding:14px 20px 20px;
}

.termo-auth-copy{
  color:#415466;
  font-family:"Lora", Georgia, serif;
  font-size:.98rem;
  line-height:1.55;
}

.termo-auth-benefits{
  margin:14px 0 0;
  padding:0;
  list-style:none;
  display:grid;
  gap:8px;
}

.termo-auth-benefits li{
  display:flex;
  gap:10px;
  align-items:flex-start;
  color:#214567;
  font-family:"Inter",sans-serif;
  font-size:.93rem;
  line-height:1.42;
}

.termo-auth-benefits i{
  color:#0B5EA8;
  margin-top:2px;
}

.termo-auth-panel{
  margin-top:16px;
  padding:16px;
  border:1px solid rgba(0, 75, 135, 0.10);
  border-radius:18px;
  background:linear-gradient(180deg, #F8FBFF 0%, #FFFFFF 100%);
}

.termo-auth-panel-title{
  color:#123A63;
  font-family:"Inter",sans-serif;
  font-size:1rem;
  font-weight:800;
  margin-bottom:8px;
}

.termo-auth-panel-copy{
  color:#526476;
  font-family:"Inter",sans-serif;
  font-size:.95rem;
  line-height:1.55;
}

.termo-auth-google-slot{
  margin-top:16px;
  min-height:42px;
}

.termo-auth-google-slot > div{
  width:100%;
}

.termo-auth-google-slot iframe{
  max-width:100%;
}

.termo-auth-muted{
  margin-top:14px;
  color:#6B7A8B;
  font-family:"Inter",sans-serif;
  font-size:.88rem;
  line-height:1.5;
}

.termo-auth-status{
  margin-top:16px;
  min-height:1.4rem;
  color:#0B5EA8;
  font-family:"Inter",sans-serif;
  font-size:.9rem;
  font-weight:600;
}

.termo-auth-status.is-error{
  color:#B42318;
}

.termo-auth-account{
  display:flex;
  gap:14px;
  align-items:center;
}

.termo-auth-account-avatar{
  width:52px;
  height:52px;
  border-radius:999px;
  object-fit:cover;
  background:#EAF2FD;
  border:1px solid rgba(0, 75, 135, 0.12);
}

.termo-auth-account-kicker{
  color:#0B5EA8;
  font-family:"Inter",sans-serif;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  line-height:1.2;
  margin-bottom:3px;
  text-transform:uppercase;
}

.termo-auth-account-name{
  color:#123A63;
  font-family:"Inter",sans-serif;
  font-size:1rem;
  font-weight:800;
}

.termo-auth-account-email{
  color:#526476;
  font-family:"Inter",sans-serif;
  font-size:.92rem;
  line-height:1.5;
}

.termo-auth-legal{
  margin-top:18px;
  padding:14px;
  border:1px solid rgba(0,75,135,.12);
  border-radius:14px;
  background:#F8FBFF;
}

.termo-auth-legal-title{color:#123A63;font-family:"Inter",sans-serif;font-size:.92rem;font-weight:800;margin-bottom:8px}
.termo-auth-legal-copy{color:#526476;font-family:"Inter",sans-serif;font-size:.84rem;line-height:1.45;margin:8px 0}
.termo-auth-check{display:flex;align-items:flex-start;gap:9px;color:#334155;font-family:"Inter",sans-serif;font-size:.86rem;line-height:1.45;margin:10px 0;cursor:pointer}
.termo-auth-check input{margin-top:4px;accent-color:#004B87}
.termo-auth-check a{color:#0B5EA8;font-weight:700}

.termo-auth-actions{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.termo-auth-google-button{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  border:1px solid rgba(15, 23, 42, 0.14);
  border-radius:999px;
  background:#FFFFFF;
  color:#334155;
  padding:12px 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  font-family:"Inter",sans-serif;
  font-size:1rem;
  font-weight:500;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.termo-auth-google-button:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15, 23, 42, 0.08);
}

.termo-auth-google-button:disabled{
  opacity:.72;
  cursor:wait;
  transform:none;
  box-shadow:none;
}

.termo-auth-google-icon{
  width:30px;
  height:30px;
  border-radius:999px;
  background:#FFFFFF;
  border:1px solid rgba(15, 23, 42, 0.08);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:"Inter",sans-serif;
  font-size:1.2rem;
  font-weight:800;
  color:#EA4335;
  flex:0 0 auto;
}

.termo-auth-shortcuts{
  margin-top:18px;
  display:grid;
  gap:10px;
}

.termo-auth-shortcut{
  display:grid;
  grid-template-columns:18px 1fr;
  gap:12px;
  align-items:flex-start;
  padding:12px 14px;
  border:1px solid rgba(0, 75, 135, 0.10);
  border-radius:14px;
  background:#FFFFFF;
  color:#123A63;
  text-decoration:none;
}

.termo-auth-shortcut i{
  color:#0B5EA8;
  margin-top:2px;
}

.termo-auth-shortcut strong{
  display:block;
  font-family:"Inter",sans-serif;
  font-size:.94rem;
  font-weight:800;
  margin-bottom:4px;
}

.termo-auth-shortcut small{
  display:block;
  color:#607286;
  font-family:"Inter",sans-serif;
  font-size:.84rem;
  line-height:1.45;
}

.termo-auth-shortcut--disabled{
  background:#F8FBFF;
  border-style:dashed;
}

.termo-auth-secondary{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid #C7D8F3;
  background:#FFFFFF;
  color:#0B5EA8;
  border-radius:999px;
  padding:10px 16px;
  font-family:"Inter",sans-serif;
  font-size:.92rem;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

@media (max-width:700px){
  .termo-study-marker-trigger{
    min-width:42px;
    max-width:42px;
    padding-left:0;
    padding-right:0;
  }

  .termo-study-marker-trigger span{
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0 0 0 0);
    white-space:nowrap;
  }

  .termo-auth-overlay{
    padding:12px;
  }

  .termo-auth-modal-header,
  .termo-auth-body{
    padding-left:16px;
    padding-right:16px;
  }

  .termo-auth-title{
    font-size:1.16rem;
  }

  .termo-auth-panel{
    padding:14px;
  }

  .termo-auth-copy{
    font-size:.92rem;
    line-height:1.45;
  }

  .termo-auth-benefits li{
    font-size:.89rem;
  }
}

html,
body{
  max-width:100%;
  overflow-x:hidden;
}

body > .page,
.page,
.content-root,
.source-fragment,
.source-embed,
.source-embed > div,
.grid,
.grid-3,
.stack{
  min-width:0;
}

img,
svg,
canvas,
video,
iframe{
  max-width:100%;
}

mjx-container,
.MathJax,
.mjx-chtml{
  max-width:100%;
}

@media (max-width:700px){
  body{
    padding:0 !important;
  }

  body > .page,
  .page{
    width:100% !important;
    max-width:none !important;
    gap:14px !important;
  }

  .hero,
  .card{
    border-radius:18px !important;
  }

  .hero-inner,
  .card{
    padding:16px !important;
  }

  .chapter-title,
  .title-main-heading,
  .title-main-slide-heading,
  .title-main-header,
  .main-title,
  .hdr-title{
    line-height:1.08 !important;
    word-break:break-word;
  }

  .chapter-text,
  .body-text,
  .content-root,
  .source-fragment{
    width:100%;
    max-width:100%;
  }

  .grid,
  .grid-3{
    grid-template-columns:1fr !important;
  }

  .math-box,
  .highlight,
  .warning,
  .insight,
  .mini-card,
  .definition-item{
    padding:14px !important;
  }

  .comparison-table-wrap,
  .table-data-wrapper{
    margin-left:-4px;
    margin-right:-4px;
    padding-bottom:2px;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
  }

  .comparison-table,
  .ensemble-summary-table{
    min-width:560px;
  }
}
