/* 2026-09-14: style.css の仕訳・表・T字勘定を、対象記事の教科書部分だけに適用。
   正本: site/css/style.css（Journal Entry 〜 Textbook Account）。要点・タイトルには適用しない。 */
:where(.grade3-lesson[data-textbook-unit]) .journal-grid {
--journal-col-min: 130px;
  --journal-col-gap: clamp(2em, 3vw, 5em);
  --journal-bottom-gap: 14px;
  --journal-group-gap: 10px;
  --journal-row-gap: 4px;
  --journal-row-attr-gap: 8px;
  --journal-row-attr-stack-gap: 14px;
  --journal-paren-pad: 1em;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: 600px;
  margin: 10px auto 0;
  padding-bottom: var(--journal-bottom-gap);
  justify-content: center;
  align-items: stretch;
  row-gap: 10px;
  column-gap: var(--journal-col-gap);
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid > div {
flex: 0 1 auto;
  min-width: var(--journal-col-min);
  display: flex;
  flex-direction: column;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-compact {
max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  flex-wrap: wrap;
  column-gap: min(var(--journal-col-gap), 5em);
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-compact:not(.is-stacked) > div {
flex: 0 1 auto;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-compact.journal-bleed {
width: calc(100% + var(--journal-bleed-left, 0px) + var(--journal-bleed-right, 0px));
  margin-left: calc(-1 * var(--journal-bleed-left, 0px));
  margin-right: calc(-1 * var(--journal-bleed-right, 0px));
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.is-stacked {
flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.is-stacked > div {
flex: 0 0 auto;
  width: 100%;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid > div:nth-child(1) {
align-items: flex-start;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid > div:nth-child(2) {
align-items: flex-end;
  margin-left: 0;
  border-left: none;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.is-stacked > div:nth-child(1) {
align-items: flex-start;
  order: 1;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.is-stacked > div:nth-child(2) {
align-items: flex-end;
  order: 2;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid > div:not(.journal-group):nth-child(1) {
padding-right: 5px;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid > div:not(.journal-group):nth-child(2) {
padding-left: 5px;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.is-stacked > div:not(.journal-group):nth-child(1),
:where(.grade3-lesson[data-textbook-unit]) .journal-grid.is-stacked > div:not(.journal-group):nth-child(2) {
padding-left: 0;
  padding-right: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-group {
align-self: stretch;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner {
display: inline-grid;
  grid-template-columns: var(--journal-label-width, max-content) var(--journal-account-width, max-content) var(--journal-amount-width, max-content);
  column-gap: var(--journal-group-gap);
  row-gap: var(--journal-row-gap);
  align-items: baseline;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-no-label .journal-group-inner {
grid-template-columns: var(--journal-account-width, max-content) var(--journal-amount-width, max-content);
}

:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.account-stack small),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.account-stack span.attr),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.journal-account > small),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.journal-account > span.attr),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.amount-stack small),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.amount-stack span.attr),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.journal-amount > small),
:where(.grade3-lesson[data-textbook-unit]) .journal-group-inner:has(.journal-amount > span.attr) {
row-gap: max(var(--journal-row-gap), var(--journal-row-attr-stack-gap));
}

:where(.grade3-lesson[data-textbook-unit]) .journal-row {
display: contents;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-row.has-attr:not(:last-child) > .journal-label,
:where(.grade3-lesson[data-textbook-unit]) .journal-row.has-attr:not(:last-child) > .journal-account,
:where(.grade3-lesson[data-textbook-unit]) .journal-row.has-attr:not(:last-child) > .journal-amount {
margin-bottom: var(--journal-row-attr-gap);
}

:where(.grade3-lesson[data-textbook-unit]) .journal-label {
font-weight: 800;
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-label.is-empty {
visibility: hidden;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-no-label .journal-label {
display: none;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-account {
position: relative;
  padding: 0 var(--journal-paren-pad);
  text-align: center;
  white-space: nowrap;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-account::before,
:where(.grade3-lesson[data-textbook-unit]) .journal-account::after {
position: absolute;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  font-weight: inherit;
  color: inherit;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-account::before {
content: "（";
  left: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-account::after {
content: "）";
  right: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-amount {
font-weight: 800;
  text-align: right;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  position: relative;
  padding-right: 0;
  min-width: 0;
  justify-self: stretch;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-amount > small,
:where(.grade3-lesson[data-textbook-unit]) .journal-amount > span.attr {
position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7em;
  color: var(--text-sub);
  font-weight: normal;
  line-height: 1;
  padding-top: 1px;
}

:where(.grade3-lesson[data-textbook-unit]) .amount-stack {
display: inline-flex;
  position: relative;
  justify-content: flex-end;
  text-align: right;
  flex-direction: row;
}

:where(.grade3-lesson[data-textbook-unit]) .amount-stack small,
:where(.grade3-lesson[data-textbook-unit]) .amount-stack span.attr {
position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7em;
  color: var(--text-sub);
  font-weight: normal;
  line-height: 1;
  padding-top: 1px;
}

:where(.grade3-lesson[data-textbook-unit]) .amount-mark {
font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: inherit;
  position: absolute;
  right: 0;
  top: 0;
  line-height: 1;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-label.journal-index {
font-weight: 700;
  font-size: 0.95rem;
  min-width: 1.6em;
  color: var(--text-main);
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-has-amount-mark .journal-amount {
padding-right: 1.4em;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid > div:not(.journal-group) > div {
align-items: baseline !important;
  margin-bottom: 18px;
  display: inline-flex;
  
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .account-stack {
display: inline-flex;
  position: relative;
  justify-content: center;
  text-align: center;
  flex-direction: row;
  
  line-height: 1.2;
}

:where(.grade3-lesson[data-textbook-unit]) .account-stack small,
:where(.grade3-lesson[data-textbook-unit]) .account-stack span.attr,
:where(.grade3-lesson[data-textbook-unit]) .journal-account > small,
:where(.grade3-lesson[data-textbook-unit]) .journal-account > span.attr {
position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;

  font-size: 0.7em;
  color: var(--text-sub);
  font-weight: normal;
  line-height: 1;
  padding-top: 1px;
}

:where(.grade3-lesson[data-textbook-unit]) .account-stack small::before,
:where(.grade3-lesson[data-textbook-unit]) .account-stack small::after,
:where(.grade3-lesson[data-textbook-unit]) .account-stack span.attr::before,
:where(.grade3-lesson[data-textbook-unit]) .account-stack span.attr::after,
:where(.grade3-lesson[data-textbook-unit]) .journal-account > small::before,
:where(.grade3-lesson[data-textbook-unit]) .journal-account > small::after,
:where(.grade3-lesson[data-textbook-unit]) .journal-account > span.attr::before,
:where(.grade3-lesson[data-textbook-unit]) .journal-account > span.attr::after {
content: "-";
}

@media (max-width: 450px) {
:where(.grade3-lesson[data-textbook-unit]) .entry-case-grid {
grid-template-columns: 1fr;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid {
max-width: none;
    flex-wrap: wrap;
    --journal-group-gap: 3px;
    --journal-col-min: 0px;
    column-gap: min(var(--journal-col-gap), 5em);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid:not(.is-stacked) > div {
flex: 0 0 auto;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-bleed {
width: calc(100% + var(--journal-bleed-left, 0px) + var(--journal-bleed-right, 0px));
    margin-left: calc(-1 * var(--journal-bleed-left, 0px));
    margin-right: calc(-1 * var(--journal-bleed-right, 0px));
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid:not(.is-stacked) > div:nth-child(1) {
align-items: flex-start;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid:not(.is-stacked) > div:nth-child(2) {
align-items: flex-end;
}
}

@container textbook (max-width: 450px) {
:where(.grade3-lesson[data-textbook-unit]) .entry-case-grid {
grid-template-columns: 1fr;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid {
max-width: none;
    flex-wrap: wrap;
    --journal-group-gap: 3px;
    --journal-col-min: 0px;
    column-gap: min(var(--journal-col-gap), 5em);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid:not(.is-stacked) > div {
flex: 0 0 auto;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid.journal-bleed {
width: calc(100% + var(--journal-bleed-left, 0px) + var(--journal-bleed-right, 0px));
    margin-left: calc(-1 * var(--journal-bleed-left, 0px));
    margin-right: calc(-1 * var(--journal-bleed-right, 0px));
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid:not(.is-stacked) > div:nth-child(1) {
align-items: flex-start;
}

:where(.grade3-lesson[data-textbook-unit]) .journal-grid:not(.is-stacked) > div:nth-child(2) {
align-items: flex-end;
}
}

:where(.grade3-lesson[data-textbook-unit]) .img-box {
width: 100%; border-radius: 8px; border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 20px; background: #fff;
  padding: 20px; display: flex; justify-content: center;
}

:where(.grade3-lesson[data-textbook-unit]) .img-box svg,
:where(.grade3-lesson[data-textbook-unit]) .img-box img {
width: 100%; height: auto; display: block;
}

:where(.grade3-lesson[data-textbook-unit]) .slide-caption {
font-size: 0.8rem; color: var(--text-sub); text-align: center;
  padding: 8px; background: #F9FAFB; border-top: 1px solid var(--border);
}

:where(.grade3-lesson[data-textbook-unit]) .comparison-table {
width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.9rem;
}

:where(.grade3-lesson[data-textbook-unit]) .comparison-table th,
:where(.grade3-lesson[data-textbook-unit]) .comparison-table td {
border: 1px solid var(--border); padding: 10px 12px;
}

:where(.grade3-lesson[data-textbook-unit]) .comparison-table th {
background: #F3F4F6; color: var(--text-main); font-weight: 800; width: 30%;
}

:where(.grade3-lesson[data-textbook-unit]) .comparison-table td {
background: #fff; color: var(--text-body);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount {
--taccount-border: #334155;
  --taccount-range: 120px;
  --taccount-min-height: 12px;
  --taccount-max: 100;
  --taccount-date-width: 2.8em;
  --taccount-cause-width: 1fr;
  --taccount-amount-width: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-name {
text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #0F172A;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-table {
display: flex;
  align-items: flex-start;
  position: relative;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-table::after {
content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--taccount-border);
  transform: translateX(-1px);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side {
flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-top: 2px solid var(--taccount-border);
  border-bottom: 2px solid var(--taccount-border);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side.is-left {
border-left: 2px solid var(--taccount-border);
  border-right: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side.is-right {
border-right: 2px solid var(--taccount-border);
  border-left: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side.is-empty {
border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side.is-strong {
border-width: 3px;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side.is-fixed {
height: var(--side-height);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-entry {
display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--taccount-border);
  background: var(--entry-bg, transparent);
  height: calc((var(--value) / var(--taccount-max)) * var(--taccount-range) + var(--taccount-min-height));
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-entry:first-child {
border-top: none;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-side.is-fixed .taccount-entry {
height: auto;
  flex: var(--weight, var(--value, 1));
  min-height: var(--taccount-min-height);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-entry.is-strong {
box-shadow: inset 0 0 0 2px var(--taccount-border);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-row {
display: grid;
  grid-template-columns: var(--taccount-date-width) minmax(2.6em, var(--taccount-cause-width)) var(--taccount-amount-width);
  width: 100%;
  align-items: center;
  column-gap: 6px;
  padding: 0 8px;
  font-size: 0.72rem;
  color: #334155;
  font-weight: 700;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-row.is-no-date {
grid-template-columns: minmax(2.6em, var(--taccount-cause-width)) var(--taccount-amount-width);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-row.is-no-date .taccount-date {
display: none;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-date {
font-size: 0.62rem; color: #475569; text-align: left;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-cause {
font-size: 0.7rem; color: #334155; white-space: nowrap; word-break: keep-all; text-align: center;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-amount {
font-size: 0.78rem; font-weight: 800; color: #0F172A; text-align: right;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount.is-retained-earnings {
transform: scale(1.03, 1.12);
  transform-origin: top center;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-totals {
display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  color: #334155;
  gap: 8px;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-total {
flex: 1;
  text-align: center;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-wrap {
position: relative;
  display: inline-block;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-bracket {
position: absolute;
  left: calc(100% + 10px);
  top: var(--bracket-top, 0px);
  height: var(--bracket-height, 40px);
  border-right: 2px solid var(--taccount-border);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-bracket::before,
:where(.grade3-lesson[data-textbook-unit]) .taccount-bracket::after {
content: "";
  position: absolute;
  right: -2px;
  width: 14px;
  border-top: 2px solid var(--taccount-border);
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-bracket::before {
top: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-bracket::after {
bottom: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .taccount-bracket-label {
position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: #334155;
  white-space: nowrap;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 {
--kanjo-home-extra-height: 10px;
  --kanjo-liability-offset-x: -14px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-preview-card {
margin-top: 14px;
  margin-bottom: 10px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-preview-title {
font-weight: 900;
  color: #0f172a;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-grid {
display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item {
padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount {
width: 100%;
  min-width: 0;
  --taccount-min-height: 18px;
  --taccount-diff-height: calc(var(--quick-home-height, 72px) + var(--kanjo-home-extra-height) - var(--quick-away-height, 44px));
  --taccount-diff-brace-size: max(calc(var(--taccount-diff-height) + 12px), 44px);
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-name {
font-size: 0.9rem;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-table {
align-items: flex-start;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-side.is-fixed {
height: var(--quick-away-height, 44px);
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-side.is-home.is-fixed {
height: calc(var(--quick-home-height, 72px) + var(--kanjo-home-extra-height));
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-side.is-home:not(.is-empty) {
background: #dbeafe;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount.is-liability .taccount-side.is-home:not(.is-empty) {
background: #fee2e2;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-side.is-home .taccount-entry {
background: transparent;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-side:has(.taccount-entry.is-empty:only-child) {
border-bottom: 0;
  background: transparent;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-entry.is-empty {
visibility: hidden;
  border-top: 0;
  background: transparent;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-cause {
white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.72rem;
  text-align: left;
  padding: 0 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff {
position: absolute;
  top: var(--taccount-diff-top, var(--quick-away-height, 44px));
  left: calc(50% - 1px);
  height: var(--taccount-diff-height);
  width: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff-brace {
position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 100%;
  line-height: 1;
  font-family: "Courier New", "Consolas", "SFMono-Regular", monospace;
  font-size: var(--taccount-diff-brace-size);
  font-weight: 400;
  text-align: center;
  color: #475569;
  overflow: visible;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff-brace::before {
content: "}";
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff-brace::after {
content: none;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff.is-right .taccount-quick-diff-brace::before {
content: "{";
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff.is-left .taccount-quick-diff-brace {
left: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff.is-right .taccount-quick-diff-brace {
left: -18px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff-label {
position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  line-height: 1.1;
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff.is-left .taccount-quick-diff-label {
left: 18px;
  text-align: left;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-diff.is-right .taccount-quick-diff-label {
right: 34px;
  text-align: right;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount {
--quick-away-height: var(--credit-height, 44px);
  --quick-home-height: var(--debit-height, 44px);
  --kanjo-home-extra-height: 0px;
  --taccount-diff-top: var(--balance-start, var(--quick-away-height, 44px));
  --taccount-diff-height: var(--balance-height, calc(var(--quick-home-height, 72px) - var(--quick-away-height, 44px)));
  --taccount-diff-brace-size: max(calc(var(--taccount-diff-height) + 12px), 44px);
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-table {
min-height: max(var(--debit-height, 44px), var(--credit-height, 44px), 18px);
  overflow: visible;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-side.is-left,
:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-side.is-right {
height: var(--side-height);
  overflow: hidden;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-side.is-left {
--side-height: var(--debit-height, 44px);
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-side.is-right {
--side-height: var(--credit-height, 44px);
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-entry {
flex: 1 1 0;
  min-height: 0;
  padding: 0 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-row {
grid-template-columns: 2.6em 1fr auto;
  gap: 4px;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-balance-snapshot .taccount-quick-diff-label {
white-space: normal;
  width: 7.8em;
  line-height: 1.05;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  padding: 1px 3px;
}

@media (max-width: 640px) {
:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-preview-card {
margin-top: 10px !important;
    margin-bottom: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-grid {
gap: 8px !important;
    margin-bottom: 10px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item {
padding: 8px !important;
    border-radius: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-row {
gap: 4px !important;
    padding-inline: 6px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 {
padding: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stages {
grid-template-columns: minmax(430px, 1fr) 24px minmax(430px, 1fr) !important;
    gap: 8px !important;
    min-width: 900px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stages.is-three {
grid-template-columns: minmax(430px, 1fr) 24px minmax(430px, 1fr) 24px minmax(430px, 1fr) !important;
    min-width: 1370px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-arrow {
font-size: 1rem !important;
    transform: none !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stage {
padding: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stage-title {
margin-bottom: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-grid {
gap: 6px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定.is-next-period-flow .lesson-t-stages.is-three {
grid-template-columns: minmax(500px, 1fr) 24px minmax(500px, 1fr) 24px minmax(500px, 1fr) !important;
    min-width: 1580px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定.is-next-period-flow .lesson-t-grid {
gap: 8px !important;
}
}

@container textbook (max-width: 640px) {
:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-preview-card {
margin-top: 10px !important;
    margin-bottom: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-grid {
gap: 8px !important;
    margin-bottom: 10px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item {
padding: 8px !important;
    border-radius: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .勘定科目紹介t字勘定 .taccount-quick-item .taccount-row {
gap: 4px !important;
    padding-inline: 6px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 {
padding: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stages {
grid-template-columns: minmax(430px, 1fr) 24px minmax(430px, 1fr) !important;
    gap: 8px !important;
    min-width: 900px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stages.is-three {
grid-template-columns: minmax(430px, 1fr) 24px minmax(430px, 1fr) 24px minmax(430px, 1fr) !important;
    min-width: 1370px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-arrow {
font-size: 1rem !important;
    transform: none !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stage {
padding: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-stage-title {
margin-bottom: 8px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定 .lesson-t-grid {
gap: 6px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定.is-next-period-flow .lesson-t-stages.is-three {
grid-template-columns: minmax(500px, 1fr) 24px minmax(500px, 1fr) 24px minmax(500px, 1fr) !important;
    min-width: 1580px !important;
}

:where(.grade3-lesson[data-textbook-unit]) .lesson-t-board.勘定科目紹介t字勘定.is-next-period-flow .lesson-t-grid {
gap: 8px !important;
}
}

:where(.grade3-lesson[data-textbook-unit]) .comparison-table tr:nth-child(even) td {
background-color: #F9FAFB;
}

:where(.grade3-lesson[data-textbook-unit]) .comparison-table tr:hover td {
background-color: #EFF6FF;
}

:where(.grade3-lesson[data-textbook-unit]) .td-num {
text-align: right;
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 0.05em;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account {
--tb-line: #334155;
  --tb-muted: #64748B;
  --tb-row-height: 22px;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  color: #0F172A;
  max-width: 640px;
  margin: 0 auto;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-title {
text-align: center;
  font-weight: 800;
  margin-bottom: 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-head {
display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 0.75rem;
  color: var(--tb-muted);
  margin-bottom: 4px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-head-cell {
text-align: center;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-body {
display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--tb-line);
  position: relative;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-body::before {
content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--tb-line);
  transform: translateX(-1px);
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-side {
padding: 6px 8px;
  display: grid;
  row-gap: 4px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-row {
display: grid;
  grid-template-columns: 44px 1fr 72px;
  column-gap: 6px;
  align-items: center;
  height: var(--tb-row-height);
  line-height: var(--tb-row-height);
  font-size: 0.8rem;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-row .amount {
text-align: right;
  font-weight: 700;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-blank.is-slash {
height: calc(var(--tb-row-height) * var(--tb-slash-rows, 2));
  position: relative;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-blank.is-slash::after {
content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-top: none;
  background: linear-gradient(to top right, transparent 49.2%, var(--tb-line) 49.6%, var(--tb-line) 50.4%, transparent 50.8%);
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-sum {
display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-sum-side {
padding: 0 8px 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-sum-line {
border-top: 1px solid var(--tb-line);
  margin-top: 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-sum-row {
display: grid;
  grid-template-columns: 44px 1fr 72px;
  column-gap: 6px;
  align-items: center;
  margin-top: 4px;
  font-size: 0.8rem;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-sum-row .amount {
text-align: right;
  font-weight: 700;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-close {
border-top: 3px double var(--tb-line);
  margin-top: 6px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-no-total .textbook-account-sum-line,
:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-no-total .textbook-account-sum-row {
display: none;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-no-close .textbook-account-close {
display: none;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-no-slash .textbook-account-blank.is-slash {
display: none;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-one-line .textbook-account-sum-line,
:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-one-line .textbook-account-sum-row {
display: none;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account.is-one-line .textbook-account-close {
margin-top: 4px;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-row.is-blue {
background: #DBEAFE;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-row.is-yellow {
background: #FEF3C7;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-row.is-green {
background: #DCFCE7;
}

:where(.grade3-lesson[data-textbook-unit]) .textbook-account-row.is-gray {
background: #F1F5F9;
}

/* 公開記事には教科書の外側のスクロール枠がないため、既存の表用ラッパーに補う。 */
.grade3-lesson[data-textbook-unit] .table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
