:root {
  --color-green: #4ade80;
  --color-purple: #a78bfa;
  --color-orange: #fb923c;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-600: #4b5563;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-blue-600: #2563eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


html {
  -webkit-text-size-adjust: 100%;
  font-feature-settings: normal;
  font-variation-settings: normal;
}

body {
  background-color: white;
  color: var(--color-gray-900);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-body {
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

::selection {
  background-color: #dbeafe;
  /* blue-100 */
}

/* Layout */
.app-container {
  margin-top: 10vh;
  min-height: 100vh;
  background-color: #ffffff;
}

.content-wrapper {
  max-width: 1280px;
  /* Increased from 1152px */
  margin: 0 auto;
  padding: 2rem 1rem;
  /* Reduced for mobile */
}

@media (min-width: 768px) {
  .content-wrapper {
    padding: 3rem 1.5rem;
  }
}

.main-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  /* gap-8 */
  margin-bottom: 3rem;
  /* mb-12 */
  border-bottom: 1px solid #e5e7eb;
  /* border-gray-200 */
  padding-bottom: 2rem;
  /* pb-8 */
}

@media (min-width: 768px) {
  .main-header {
    flex-direction: row;
  }
}

.header-content {
  flex: 1;
}

.header-title {
  font-size: 1.875rem;
  /* text-3xl for mobile */
  font-weight: 700;
  /* font-bold */
  letter-spacing: -0.025em;
  /* tracking-tight */
  margin-bottom: 1rem;
  /* mb-4 */
  display: flex;
  flex-wrap: wrap;
  /* Allow wrapping on small screens */
  align-items: baseline;
  gap: 0.5rem;
  /* gap-2 */
}

@media (min-width: 768px) {
  .header-title {
    font-size: 3rem;
    /* text-5xl */
    margin-bottom: 1.5rem;
    /* mb-6 */
    gap: 1rem;
    /* gap-4 */
  }
}

.header-meta {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  /* space-y-1 */
  font-size: 0.875rem;
  /* text-sm */
  color: #4b5563;
  /* text-gray-600 */
}

.header-meta a {
  color: #2563eb;
  /* text-blue-600 */
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  word-break: break-all;
  /* Prevent long URLs from overflowing */
}

.header-meta a:hover {
  text-decoration: underline;
}

.sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* space-y-3 */
}

@media (min-width: 768px) {
  .sidebar {
    width: 16rem;
    /* w-64 */
  }
}

.sidebar-button {
  width: 100%;
  padding: 0.75rem 1rem;
  /* py-3 px-4 */
  background-color: #f0f0f0;
  border: 2px solid #000000;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-button:hover {
  background-color: #e5e7eb;
}

/* Main Content Area */
.abbreviation-section {
  margin-top: 2rem;
}

.section-subtitle {
  font-weight: 700;
  color: var(--color-gray-600);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.abbreviation-table {
  width: 100%;
  max-width: 24rem;
  border-collapse: collapse;
  border: 1px solid var(--color-gray-300);
}

.abbreviation-table td {
  border: 1px solid var(--color-gray-300);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}

.abbr-code {
  width: 4rem;
  text-align: center;
}

/* Question Section */
.question-section {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.q1-section {
  gap: 1.25rem;
}

.q1-section .answer-badge-wrapper {
  margin: 1.25rem 0 0.625rem;
}

.q1-section .content-box-gray {
  margin: 1.25rem 0;
}

.q1-section .content-title-row {
  margin: 1.25rem 0 0.625rem;
}

.q1-section .content-box-blue {
  margin: 1.25rem 0;
}

.q1-section .explanation-text {
  margin: 0.625rem 0;
}

.q1-section .answer-red-underline {
  margin: 1.25rem 0;
}

.q1-section .accounting-cards-grid {
  margin: 1.25rem 0;
}

.q1-section .question-header {
  margin: 1.25rem 0 0.625rem;
}

.question-main-title {
  border: 2px solid black;
  padding: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.question-header {
  background-color: #a5d8eb;
  border-radius: 9999px;
  padding: 0.375rem 1rem;
  display: inline-block;
  width: fit-content;
  font-weight: 700;
  font-size: 1rem;
}

.answer-badge-wrapper {
  display: flex;
  align-items: center;
  background-color: #f0fdf4;
  border-left: 6px solid #22c55e;
  padding: 0.5rem 1rem;
  width: fit-content;
  border-radius: 0.25rem;
  gap: 0.5rem;
}

.answer-badge-label {
  font-style: italic;
  font-weight: 900;
  color: #16a34a;
  font-size: 1.25rem;
}

.answer-badge-text {
  font-weight: 700;
  font-size: 1.125rem;
}

.content-box-gray {
  background-color: #f2f2f2;
  padding: 1rem;
  border-radius: 0.5rem;
  line-height: 1.625;
  font-size: 15px;
}

.highlight-blue {
  color: #2563eb;
  font-weight: 700;
}

.content-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.content-box-blue {
  background-color: #eef9fc;
  border-left: 4px solid #a5d8eb;
  padding: 1rem;
  border-radius: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-style: italic;
  overflow-x: auto;
}

.quote-text {
  font-style: italic;
  line-height: 1.8;
  color: var(--color-gray-800);
}

.quote-source {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.explanation-text {
  line-height: 1.8;
  color: var(--color-gray-800);
  margin: 0.25rem 0;
  font-size: 15px;
  padding-left: 0.5rem;
}

.answer-red-underline {
  color: #dc2626;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 2px solid #dc2626;
  padding-bottom: 0.125rem;
  width: fit-content;
  margin: 0.5rem 0;
}

.text-green-600 {
  color: #16a34a;
}

.question-subheader-blue {
  background-color: #e0f2fe;
  padding: 0.75rem 1rem;
  font-weight: bold;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.text-link {
  color: #2563eb;
  text-decoration: underline;
}

.content-title-orange {
  background-color: #fff7ed;
  padding: 0.5rem 1rem;
  font-weight: bold;
  font-size: 1.125rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.journal-table {
  width: 100%;
  max-width: 800px;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: var(--font-mono);
}

.journal-table td {
  border: 1px solid var(--color-gray-200);
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.journal-label {
  width: 25%;
  text-align: left;
  color: var(--color-gray-800);
}

.journal-value {
  width: 25%;
  text-align: right;
  color: var(--color-gray-900);
}

.explanation-box-green {
  background-color: #f0fdf4;
  border-left: 4px solid var(--color-green);
  padding: 1rem;
  margin-top: 1rem;
  line-height: 1.8;
  color: var(--color-gray-800);
}

.underline-black {
  text-decoration: underline;
}

.accounting-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

@media (min-width: 768px) {
  .accounting-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.accounting-card {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.text-red-600 {
  color: #dc2626;
}

.font-bold {
  font-weight: 700;
}

.item-badge {
  background-color: #fce7f3;
  color: #be185d;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.content-sub-header {
  font-weight: bold;
  font-size: 1.125rem;
  border-bottom: 1px solid var(--color-gray-200);
  padding-bottom: 0.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.answer-summary-red {
  color: #dc2626;
  font-size: 1.5rem;
  font-weight: 900;
  border-bottom: 3px solid #dc2626;
  padding-bottom: 0.25rem;
  width: fit-content;
  margin: 2rem 0;
}

.analysis-item-header {
  display: flex;
  align-items: center;
  background-color: #f0fdf4;
  border-left: 6px solid #16a34a;
  padding: 0.5rem 1rem;
  margin: 1.5rem 0 1rem;
  gap: 0.75rem;
  border-radius: 0.25rem;
}

.analysis-item-label {
  font-style: italic;
  font-weight: 900;
  color: #16a34a;
  font-size: 1.25rem;
}

.analysis-item-title {
  font-weight: bold;
  font-size: 1.125rem;
  color: var(--color-gray-900);
}

.formula-box {
  background-color: #eff6ff;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  font-style: italic;
  color: var(--color-gray-800);
}

.answer-red-bold-underline {
  color: #dc2626;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 2px solid #dc2626;
  padding-bottom: 0.125rem;
  width: fit-content;
  margin: 1rem 0;
}

.card-label {
  font-size: 0.65rem;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
}

.card-title {
  font-weight: bold;
  color: #111827;
}


.glossary-intro {
  margin-top: 2rem;
}

.toc-box {
  margin-top: 1rem;
}

.toc-list {
  columns: 2; column-gap: 2rem; padding-left: 1.25rem;
}

.toc-list li {
  break-inside: avoid; margin: 0.25rem 0;
}

.toc-list .level-2 {
  margin-left: 1rem;
}

.toc-list .level-3 {
  margin-left: 2rem;
  font-size: 0.92em;
}

.glossary-section {
  scroll-margin-top: 110px;
}

.glossary-term {
  margin-top: 1.25rem;
}

.glossary-definition {
  margin-top: 0.5rem;
}

.glossary-point {
  margin-top: 0.5rem;
}

.glossary-list {
  display: block;
  padding-left: 2rem;
  list-style-position: outside;
}

.glossary-list li {
  margin: 0.35rem 0;
}

.code-block pre {
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}

.code-block code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.table-container {
  overflow-x: auto;
  margin: 1rem 0;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container th, .table-container td {
  border: 1px solid var(--color-gray-300);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

.table-container th {
  background: var(--color-gray-100);
}

@media (max-width: 768px) {
  .toc-list { columns: 1; }
  .toc-list .level-2, .toc-list .level-3 { margin-left: 0.75rem; }
}


.video-aside {
  position: sticky;
  top: 90px;
  margin-left: 30px;
  align-self: start;
  height: fit-content;
}
.video-aside-sp {
  display: none;
}

@media (max-width: 768px) {
  .video-aside {
    display: none;
  }
  .video-aside-sp {
    display: block;
    position: sticky;
    top: 80px;
    z-index: 100;
    background-color: #fff;
    width: 100%;
    align-self: start;
    justify-content: center;

  }
}


.video-sec {
  display: flex;
  justify-content: center;
  justify-content: vertical;
  align-items: center;
  width: 100%;
}

.page {
  display: grid;
  grid-template-columns: 70% 1fr;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page{
    display: flex;
    flex-direction: column;
  }
}

.video-box {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  width: 100%;
}

@media (max-width: 768px) {
  .video-box {
    margin-bottom: 30px;
    width: auto;
    height: 20vh;
  }
}
