/* Automatic homework calculator and its shared material preview. */
.btl-app .btl-hw-calculator-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(23 33 59 / 42%);
}
.btl-app .btl-hw-calculator {
  display: flex;
  flex-direction: column;
  width: min(1160px, 100%);
  min-width: 0;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid #e5e7ee;
  border-radius: 12px;
  background: #fff;
  color: #202534;
  box-shadow: 0 24px 80px rgb(23 33 59 / 20%);
  font-variant-numeric: tabular-nums;
}
.btl-app .btl-hw-calculator-heading { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid #e5e7ee; }
.btl-app .btl-hw-calculator-heading h2 { margin: 0; color: #202534; font-size: 19px; font-weight: 650; letter-spacing: -.035em; }
.btl-app .btl-hw-calculator-heading p { margin-top: 5px; color: #5f6878; font-size: 12px; overflow-wrap: anywhere; }
.btl-app .btl-hw-calculator-heading p > span { color: #8b92a1; }
.btl-app .btl-hw-calculator-close { display: grid; flex-shrink: 0; place-items: center; width: 40px; height: 40px; margin: -6px -8px 0 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #737b8c; font-size: 23px; line-height: 1; cursor: pointer; }
.btl-app .btl-hw-calculator-scroll { min-height: 0; padding: 0 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd1dc transparent; scroll-padding-block: 18px 92px; }
.btl-app .btl-hw-calculator-modes { display: flex; gap: 24px; margin-bottom: 22px; border-bottom: 1px solid #e5e7ee; }
.btl-app .btl-hw-calculator-modes > button { min-height: 48px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #7b8392; font-size: 13px; font-weight: 550; cursor: pointer; transition: color 140ms, border-color 140ms; }
.btl-app .btl-hw-calculator-modes > button.is-active { border-bottom-color: #3449df; color: #3449df; font-weight: 650; }
.btl-app .btl-hw-calculator-columns { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); align-items: start; gap: 28px; margin-bottom: 24px; }
.btl-app .btl-hw-calculator-settings { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.btl-app .btl-hw-calculator-section-title { margin: 0 0 1px; color: #202534; font-size: 14px; font-weight: 650; }
.btl-app .btl-hw-calculator-label { margin-bottom: 6px; color: #5f6878; font-size: 12px; font-weight: 500; line-height: 1.6; }
.btl-app .btl-hw-calculator-input { min-height: 40px; padding: 8px 11px; background: #fff; font-size: 13px; }
.btl-app .btl-hw-calculator-status-toggle { min-height: 40px; padding: 7px 8px; border: 1px solid #e5e7ee; border-radius: 8px; background: #f7f8fb; color: #8b92a1; font-size: 11px; font-weight: 550; line-height: 1.5; cursor: pointer; transition: background-color 140ms, border-color 140ms; }
.btl-app .btl-hw-calculator-status-toggle.is-active { border-color: var(--btl-hw-status-border); background: var(--btl-hw-status-bg); color: var(--btl-hw-status-color); }
.btl-app .btl-hw-calculator-start { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.btl-app .btl-hw-calculator-start > .btl-hw-calculator-label { width: 100%; margin-bottom: 0; }
.btl-app .btl-hw-calculator-start > .btl-hw-calculator-label > span { display: block; margin-top: 2px; color: #8b92a1; font-size: 11px; overflow-wrap: anywhere; }
.btl-app .btl-hw-calculator-formula { color: #7b8392; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.btl-app .btl-hw-calculator-formula b { color: #424b5c; font-weight: 600; }
.btl-app .btl-hw-calculator-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0 13px; border-top: 1px solid #e5e7ee; }
.btl-app .btl-hw-calculator-total h3 { margin: 0; color: #202534; font-size: 14px; font-weight: 650; }
.btl-app .btl-hw-calculator-total p { margin-top: 4px; color: #7b8392; font-size: 11px; }
.btl-app .btl-hw-calculator-total-value { display: flex; flex-shrink: 0; align-items: baseline; gap: 5px; color: #3449df; white-space: nowrap; }
.btl-app .btl-hw-calculator-total-value strong { font-size: 31px; line-height: 1; font-weight: 650; letter-spacing: -.04em; }
.btl-app .btl-hw-calculator-total-value > span { color: #7b8392; font-size: 12px; }
.btl-app .btl-hw-calculator-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 11px 0; border-block: 1px solid #edf0f5; }
.btl-app .btl-hw-calculator-stats > div { min-width: 0; padding: 0 3px; text-align: center; }
.btl-app .btl-hw-calculator-stats > div + div { border-left: 1px solid #edf0f5; }
.btl-app .btl-hw-calculator-result { padding: 14px 15px; border: 1px solid #e5e7ee; border-radius: 8px; background: #f7f8fb; overflow-wrap: anywhere; }
.btl-app .btl-hw-calculator-result h4 { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin: 0; color: #424b5c; font-size: 12px; font-weight: 650; line-height: 1.6; }
.btl-app .btl-hw-calculator-result p { margin: 5px 0 0; color: #5f6878; font-size: 12px; font-weight: 400; line-height: 1.8; white-space: pre-wrap; }
.btl-app .btl-hw-calculator-result p:only-child { margin: 0; }
.btl-app .btl-hw-calculator-result-details { margin-top: 7px; }
.btl-app .btl-hw-calculator-result-details:only-child { margin-top: 0; }
.btl-app .btl-hw-calculator-result-details > summary { min-height: 40px; padding: 10px 0; color: #3449df; font-size: 11px; font-weight: 550; cursor: pointer; }
.btl-app .btl-hw-calculator-result-details > summary:focus-visible { outline: 2px solid #3449df; outline-offset: 2px; border-radius: 4px; }
.btl-app .btl-hw-calculator-result-details > p { max-height: 220px; padding-right: 4px; overflow-y: auto; scrollbar-width: thin; }
.btl-app .btl-hw-calculator-complete { padding: 16px; border: 1px solid #d8e9e1; border-radius: 8px; background: #f7fbf9; color: #358168; font-size: 13px; line-height: 1.6; }
.btl-app .btl-hw-calculator-empty { padding: 20px; border: 1px solid #e5e7ee; border-radius: 8px; background: #fafbfc; color: #7b8392; font-size: 13px; line-height: 1.8; }
.btl-app .btl-hw-calculator-wrong { display: grid; gap: 16px; margin-bottom: 24px; }
.btl-app .btl-hw-calculator-wrong > div:first-child { max-width: 360px; }
.btl-app .btl-hw-calculator-wrong-list { max-height: 180px; padding: 15px; overflow-y: auto; border: 1px solid #e5e7ee; border-radius: 8px; background: #fff; line-height: 1.8; overflow-wrap: anywhere; }

.btl-app .btl-hw-calculator-dates { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 1fr); align-items: start; gap: 24px; padding: 22px 0; border-top: 1px solid #e5e7ee; }
.btl-app .btl-hw-calculator-dates-heading h3 { margin: 0; color: #202534; font-size: 14px; font-weight: 650; }
.btl-app .btl-hw-calculator-dates-heading p { margin-top: 5px; color: #7b8392; font-size: 12px; line-height: 1.6; }
.btl-app .btl-hw-calculator-dates-heading > span { display: inline-block; margin-top: 14px; color: #3449df; font-size: 12px; font-weight: 550; }
.btl-app .btl-hw-calculator-dates-heading { min-width: 0; }
.btl-app .btl-hw-calculator-distribution { margin-top: 14px; padding: 15px; border-radius: 10px; background: #f7f8fb; box-shadow: inset 0 0 0 1px #e9ecf3; font-variant-numeric: tabular-nums; }
.btl-app .btl-hw-calculator-distribution-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.btl-app .btl-hw-calculator-distribution-heading h4 { margin: 0; color: #202534; font-size: 12px; font-weight: 650; }
.btl-app .btl-hw-calculator-distribution-heading > span { color: #8b92a1; font-size: 10px; }
.btl-app .btl-hw-calculator-distribution .btl-hw-calculator-distribution-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin: 6px 0 12px; color: #727c8d; font-size: 11px; }
.btl-app .btl-hw-calculator-distribution-summary strong { color: #3449df; font-size: 14px; font-weight: 650; }
.btl-app .btl-hw-calculator-distribution-summary > span { margin-inline: 2px; color: #adb4c1; }
.btl-app .btl-hw-calculator-distribution-list { display: grid; gap: 6px; max-height: 218px; margin: 0; padding: 0 3px 0 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd1dc transparent; list-style: none; }
.btl-app .btl-hw-calculator-distribution-list:focus-visible { outline: 2px solid #3449df; outline-offset: 3px; border-radius: 4px; }
.btl-app .btl-hw-calculator-distribution-list > li { display: grid; grid-template-columns: 60px minmax(20px, 1fr) auto; align-items: center; gap: 10px; min-height: 30px; }
.btl-app .btl-hw-calculator-distribution-list time { display: flex; align-items: baseline; gap: 6px; color: #5f6878; white-space: nowrap; }
.btl-app .btl-hw-calculator-distribution-list time b { min-width: 30px; font-size: 12px; font-weight: 550; }
.btl-app .btl-hw-calculator-distribution-list time > span { color: #8b92a1; font-size: 10px; }
.btl-app .btl-hw-calculator-distribution-bar { height: 7px; overflow: hidden; border-radius: 3px; background: #e7eaf2; }
.btl-app .btl-hw-calculator-distribution-bar > span { display: block; height: 100%; border-radius: inherit; background: #6575e8; transition: width 160ms ease-out; }
.btl-app .btl-hw-calculator-distribution-list .is-due .btl-hw-calculator-distribution-bar > span { background: #3449df; }
.btl-app .btl-hw-calculator-distribution-amount { display: flex; align-items: baseline; justify-content: flex-end; gap: 3px; min-width: 48px; color: #8b92a1; font-size: 10px; white-space: nowrap; }
.btl-app .btl-hw-calculator-distribution-amount strong { color: #424b5c; font-size: 13px; font-weight: 650; }
.btl-app .btl-hw-calculator-distribution-list .is-zero .btl-hw-calculator-distribution-amount strong { color: #a8afbb; }
.btl-app .btl-hw-calculator-distribution .btl-hw-calculator-distribution-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e5e7ee; color: #8b92a1; font-size: 10px; line-height: 1.7; text-wrap: pretty; }
.btl-app .btl-hw-calculator-distribution .btl-hw-calculator-distribution-placeholder { margin: 12px 0 0; color: #7b8392; font-size: 12px; line-height: 1.8; text-wrap: pretty; }
.btl-app .btl-hw-calculator-calendar { min-width: 0; max-width: 520px; width: 100%; justify-self: end; }
.btl-app .btl-hw-calculator-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.btl-app .btl-hw-calculator-month > button { width: 40px; height: 40px; border: 1px solid #e5e7ee; border-radius: 8px; background: #fff; color: #737b8c; font-size: 21px; line-height: 1; cursor: pointer; }
.btl-app .btl-hw-calculator-month > span { color: #424b5c; font-size: 13px; font-weight: 600; }
.btl-app .btl-hw-calculator-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.btl-app .btl-hw-calculator-weekday { padding: 3px 0 6px; font-size: 10px; font-weight: 500; text-align: center; }
.btl-app .btl-hw-calculator-day { min-width: 0; min-height: 40px; padding: 7px 0; border: 0; border-radius: 6px; background: transparent; color: var(--btl-hw-day-color, #424b5c); font-size: 12px; font-weight: 500; cursor: pointer; }
.btl-app .btl-hw-calculator-day.is-in-range { background: #edf0ff; color: #3449df; }
.btl-app .btl-hw-calculator-day.is-start { background: #202534; color: #fff; font-weight: 650; cursor: default; }
.btl-app .btl-hw-calculator-day.is-due { background: #3449df; color: #fff; font-weight: 650; }
.btl-app .btl-hw-calculator-day.is-past { opacity: .35; cursor: default; }
.btl-app .btl-hw-calculator-day.is-removed { color: #a8afbb; text-decoration: line-through; }
.btl-app .btl-hw-calculator-footer { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -24px; padding: 15px 24px; border-top: 1px solid #e5e7ee; background: #fff; box-shadow: 0 -5px 18px rgb(32 37 52 / 3%); }
.btl-app .btl-hw-calculator-footer.is-empty { justify-content: flex-end; margin-top: 20px; }
.btl-app .btl-hw-calculator-footer-actions { display: flex; flex-shrink: 0; gap: 8px; }
.btl-app .btl-hw-calculator-due-summary { display: flex; flex-wrap: wrap; gap: 4px 8px; min-width: 0; color: #8b92a1; font-size: 11px; }
.btl-app .btl-hw-calculator-due-summary strong { color: #5f6878; font-size: 12px; font-weight: 600; }
.btl-app .btl-hw-calculator-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid #e5e7ee; border-radius: 8px; background: #fff; color: #5f6878; font-size: 12px; font-weight: 550; line-height: 1.5; white-space: nowrap; cursor: pointer; transition: background-color 140ms, border-color 140ms; }
.btl-app .btl-hw-calculator-button.is-primary { min-width: 105px; border-color: #3449df; background: #3449df; color: #fff; }
.btl-app .btl-hw-calculator-button.is-quiet { padding: 6px 9px; font-size: 10px; }
.btl-app .btl-hw-calculator-button.is-selected { border-color: #d4dbff; background: #edf0ff; color: #3449df; }
.btl-app .btl-hw-calculator-button:disabled { border-color: #e5e7ee; background: #f7f8fb; color: #a5adba; cursor: not-allowed; }
.btl-app .btl-hw-calculator :is(button, input, select):focus-visible,
.btl-app .btl-hw-calculator-nodes button:focus-visible { outline: 2px solid #3449df; outline-offset: 2px; }

.btl-app .btl-hw-calculator-nodes { min-width: 0; padding: 0; color: #202534; }
.btl-app .btl-hw-calculator-nodes-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.btl-app .btl-hw-calculator-nodes-heading h3 { margin: 0; color: #202534; font-size: 14px; font-weight: 650; }
.btl-app .btl-hw-calculator-nodes-heading p { margin: 4px 0 0; color: #7b8392; font-size: 10px; line-height: 1.6; }
.btl-app .btl-hw-calculator-node-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; }
.btl-app .btl-hw-calculator-node-legend { display: inline-flex; align-items: center; gap: 4px; color: #7b8392; font-size: 9px; font-weight: 500; white-space: nowrap; }
.btl-app .btl-hw-calculator-node-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; padding: 1px 3px 1px 1px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd1dc transparent; }
.btl-app .btl-hw-calculator-node { min-width: 0; padding: 14px; border: 1px solid #e5e7ee; border-radius: 10px; background: #fff; }
.btl-app .btl-hw-calculator-node.is-current { border-color: #cdd5fb; }
.btl-app .btl-hw-calculator-node.is-wrong-review { border-color: #efd8dc; }
.btl-app .btl-hw-calculator-node.is-excluded { border-color: #e5e7ee; background: #f7f8fb; opacity: .65; }
.btl-app .btl-hw-calculator-node-title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #202534; font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.btl-app .btl-hw-calculator-node-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.btl-app .btl-hw-calculator-node-tags > span { max-width: 100%; padding: 2px 5px; border-radius: 4px; background: #f0f2f6; color: #7b8392; font-size: 9px; font-weight: 500; overflow-wrap: anywhere; }
.btl-app .btl-hw-calculator-node-tags > .is-current { background: #edf0ff; color: #3449df; }
.btl-app .btl-hw-calculator-node-tags > .is-wrong-review { background: #fff1f3; color: #b5505b; }
.btl-app .btl-hw-calculator-node-total { display: flex; align-items: baseline; gap: 3px; color: #7b8392; font-size: 9px; }
.btl-app .btl-hw-calculator-node-total strong { color: #424b5c; font-size: 15px; font-weight: 650; }
.btl-app .btl-hw-calculator-node-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 12px; padding: 9px 0; border-block: 1px solid #edf0f5; text-align: center; }
.btl-app .btl-hw-calculator-node-stats > div { font-size: 9px; font-weight: 500; }
.btl-app .btl-hw-calculator-node-stats strong { display: block; margin-top: 3px; color: #424b5c; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.btl-app .btl-hw-calculator-node-problems { display: flex; flex-wrap: wrap; align-content: flex-start; min-height: 64px; max-height: 116px; margin-top: 10px; padding: 7px 4px; overflow: hidden; border-radius: 6px; background: #f7f8fb; }
.btl-app .btl-hw-calculator-node-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-top: 9px; color: #8b92a1; font-size: 9px; font-weight: 500; font-variant-numeric: tabular-nums; }

@media (hover: hover) {
  .btl-app .btl-hw-calculator-close:hover,
  .btl-app .btl-hw-calculator-button:hover:not(:disabled),
  .btl-app .btl-hw-calculator-month > button:hover { border-color: #cbd1dc; background: #f5f6fa; color: #3449df; }
  .btl-app .btl-hw-calculator-button.is-primary:hover:not(:disabled) { border-color: #293dcb; background: #293dcb; color: #fff; }
  .btl-app .btl-hw-calculator-day:hover:not(.is-start):not(.is-due):not(.is-past) { background: #edf0ff; color: #3449df; }
}
@media (max-width: 900px) {
  .btl-app .btl-hw-calculator-columns { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .btl-app .btl-hw-calculator-settings { gap: 14px; }
  .btl-app .btl-hw-calculator-dates { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .btl-app .btl-hw-calculator-calendar { justify-self: start; }
}
@media (max-width: 640px) {
  .btl-app .btl-hw-calculator-backdrop { padding: 12px; }
  .btl-app .btl-hw-calculator { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .btl-app .btl-hw-calculator-heading { padding: 18px 16px 16px; }
  .btl-app .btl-hw-calculator-heading h2 { font-size: 17px; }
  .btl-app .btl-hw-calculator-scroll { padding-inline: 16px; scroll-padding-bottom: 120px; }
  .btl-app .btl-hw-calculator-footer { flex-wrap: wrap; margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .btl-app .btl-hw-calculator-due-summary { width: 100%; }
  .btl-app .btl-hw-calculator-footer-actions { width: 100%; }
  .btl-app .btl-hw-calculator-footer-actions > button { flex: 1; }
  .btl-app .btl-hw-calculator-node-grid { max-height: 420px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .btl-app .btl-hw-calculator *, .btl-app .btl-hw-calculator-nodes * { transition: none; }
}
