.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/*=====  Code Styling  ======*/
pre,
code {
  font-family: "Geist Mono", monospace;
  background-color: var(--background-lighter);
  border: 2px solid var(--border-color);
}

code {
  padding: 0.2em 0.4em;
}

/* Inline code badge styling */
.inline-code-badge,
code.badge {
  font-family: "Geist Mono", monospace;
  background-color: var(--background-lighter);
  border: 1px solid var(--border-color);
  border-radius: 1px;
  padding: 0.2em 0.4em;
  font-size: 0.9em;
  color: var(--primary-color);
  white-space: nowrap;
  font-weight: 600;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  white-space: pre;
  margin: 1.5rem 0;
}

/* Regular pre blocks for code */
pre:not(.math-block):not(.haiku) {
  white-space: pre-wrap;
}

/* Code inside pre */
pre > code {
  display: block;
  background-color: transparent;
  border: none;
  padding: 0;
}

/* Special styling for math blocks */
pre.math-block {
  display: flex;
  justify-content: center;
  background-color: var(--background-lightest);
  border: 1px solid var(--primary-color-light);
  border-left: 2px solid var(--primary-color-medium);
  padding: 1.75rem 1rem;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

/*=====  Token Section Styles  ======*/
.token-section {
  margin: 2.5rem 0;
  padding: 0;
  background: transparent;
  border: none;
  position: relative;
}

.token-section h5 {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary-color);
  margin: 0 0 0.75rem 0;
  padding-top: 0.1rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: relative;
}

.token-section h5::after {
  display: none;
}

/* Token list styling */
ul.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0.5rem;
  margin: 0.5rem 0 1rem 0;
  border: 1px solid var(--primary-color-light);
  border-radius: 1px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  background: rgba(247, 249, 250, 0.5);
}

ul.tokens li {
  margin-bottom: 0;
}

ul.tokens code {
  background-color: rgba(4, 113, 169, 0.04);
  border-radius: 1px;
  padding: 0.25em 0.4em;
  color: rgba(4, 113, 169, 0.9);
  font-weight: 600;
  display: inline-block;
  line-height: 1;
  font-size: 0.85rem;
  border: 1px solid rgba(4, 113, 169, 0.2);
  text-decoration: none;
}

/*=====  Completion Container  ======*/
.completion-container {
  position: relative;
  margin: 1.2rem 0 1.2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  font-weight: 500;
  color: #000;
  border-radius: 1px;
  overflow: visible;
}

.input-box {
  border: 1px solid rgba(4, 113, 169, 0.2);
  border-bottom: none;
  padding: 0.8rem 1rem;
  margin: 0;
  font-family: "Geist Mono", monospace;
  width: 100%;
  background-color: white;
  line-height: 1.5;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 1px 1px 0 0;
  color: rgba(0, 0, 0, 0.85);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
}

.input-box::before {
  content: "PROMPT";
  position: absolute;
  top: -0.5rem;
  left: 0.75rem;
  background-color: white;
  padding: 0 0.4rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.05em;
  z-index: 10;
  text-transform: uppercase;
}

.demo-output {
  border: 1px solid rgba(4, 113, 169, 0.2);
  border-top: 1px dashed rgba(4, 113, 169, 0.2);
  margin: 0;
  width: 100%;
  min-height: 60px;
  border-radius: 0 0 1px 1px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  padding: 0.8rem 1rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.85);
  background-color: rgba(249, 249, 249, 0.5);
  white-space: pre-line !important;
  display: block;
}

.demo-output::before {
  content: "COMPLETION";
  position: absolute;
  top: -0.5rem;
  right: 0.75rem;
  background-color: white;
  padding: 0 0.4rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.05em;
  z-index: 10;
  text-transform: uppercase;
}

/*=====  Integrated Example Components  ======*/
.integrated-example {
  margin: 1.2rem 0;
  font-family: "Geist Mono", monospace;
  width: 100%;
  border: 1px solid rgba(4, 113, 169, 0.2);
  border-radius: 1px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.example-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(4, 113, 169, 0.15);
  background-color: #fff;
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.4;
  box-sizing: border-box;
  outline: none;
  font-weight: 500;
}

.example-output {
  padding: 0.8rem 0.9rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.85);
  background-color: rgba(249, 249, 249, 0.5);
  white-space: pre-line !important;
  display: block;
}

/* Highlighted text within output */
.example-highlight {
  color: var(--highlight-color);
  font-weight: 700;
  background: rgba(237, 66, 205, 0.08);
  padding: 0.1em 0.2em;
  border-radius: 1px;
}

/*=====  Figure/Figcaption Styles  ======*/
figure:not(.haiku-container):not(.article-banner) {
  margin: 2rem auto;
  max-width: 500px;
  position: relative;
  padding-left: 2px;
  border-left: 4px solid var(--primary-color);
}

figure:not(.haiku-container):not(.article-banner) figcaption {
  position: absolute;
  top: -1rem;
  right: 0;
  background: #ffffff;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid rgba(4, 113, 169, 0.2);
}

figcaption {
  font-family: "Geist Mono", monospace;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/*=====  Haiku Components  ======*/
figure.haiku-container {
  margin: 1.5rem 0 1.75rem;
  max-width: 420px;
  position: relative;
  padding-left: 0;
  border: 1px solid var(--primary-color-light);
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(4, 113, 169, 0.04);
  background: linear-gradient(
    to right,
    rgba(4, 113, 169, 0.02),
    rgba(4, 113, 169, 0.005)
  );
  overflow: hidden;
  border-left: 3px solid var(--primary-color);
}

.haiku-container figcaption {
  position: relative;
  top: 0;
  padding: 0.25rem 0.75rem;
  background: rgba(4, 113, 169, 0.04);
  border-bottom: 1px solid rgba(4, 113, 169, 0.08);
  text-align: left;
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: rgba(4, 113, 169, 0.8);
}

.haiku {
  font-family: "Geist", sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: left;
  color: var(--text-color-dark);
  border: none;
  padding: 0.7rem 1.1rem 0.8rem;
  margin: 0;
  max-width: 100%;
  white-space: pre-line;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  letter-spacing: -0.01em;
}

/*=====  MathJax Styling  ======*/
.MathJax {
  margin: 0 auto !important;
  text-align: center !important;
  color: var(--primary-color) !important;
}

.MathJax_Display {
  overflow-x: auto;
  overflow-y: hidden;
}

/*=====  List Variants  ======*/

/* Advantages list */
ul.advantages-list {
  margin: 1rem 0 1.5rem;
  list-style-type: square;
  border-left: 2px solid var(--primary-color-light);
  padding-left: 1.5rem;
  margin-left: 0.5rem;
}

ul.advantages-list li {
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--primary-color);
}

ul.advantages-list li::marker {
  color: var(--primary-color);
  font-size: 0.8em;
}

/* Future work list */
ul.future-work-list {
  margin: 1rem 0 1.5rem;
  padding-left: 1.5rem;
}

ul.future-work-list li {
  font-weight: 400;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

ul.future-work-list li strong {
  font-weight: 700;
  color: var(--primary-color);
}

/*=====  Length Control Section  ======*/
.length-control-section {
  margin: 1.5rem 0;
  padding: 0;
  background: transparent;
  border: none;
  position: relative;
}

.length-control-header {
  margin-bottom: 1rem;
}

.length-control-header h4 {
  margin: 0 0 0.3rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-color);
  letter-spacing: 0.02em;
  display: inline-block;
}

.length-control-header p {
  margin: 0 0 0.8rem 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(3, 105, 155, 0.9);
  font-weight: 500;
}

.length-control-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin: 0 0 1rem 0;
  padding: 0;
}

.length-tab {
  padding: 0.3rem 0.6rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
  color: rgba(4, 113, 169, 0.5);
  text-decoration: none;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: inline-block;
}

.length-tab:hover {
  color: var(--primary-color);
  opacity: 0.8;
}

.length-tab.active {
  color: var(--primary-color);
  font-weight: 600;
  border: 2px solid var(--primary-color);
  padding: calc(0.3rem - 2px) calc(0.6rem - 2px);
}

.length-control-container {
  position: relative;
  margin: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  border-radius: 1px;
  overflow: visible;
  min-height: 180px; /* Reserve space for largest output */
}

.length-prompt {
  border: 1px solid rgba(4, 113, 169, 0.2);
  border-bottom: none;
  padding: 0.8rem 1rem;
  margin: 0;
  font-family: "Geist Mono", monospace;
  background-color: white;
  line-height: 1.5;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 1px 1px 0 0;
  color: rgba(0, 0, 0, 0.85);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
}

.length-prompt::before {
  content: "PROMPT";
  position: absolute;
  top: -0.5rem;
  left: 0.75rem;
  background-color: white;
  padding: 0 0.4rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.05em;
  z-index: 10;
  text-transform: uppercase;
}

.prompt-label {
  display: none;
}

.prompt-text {
  font-family: "Geist Mono", monospace;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 500;
}

.length-example {
  display: none;
  border: 1px solid rgba(4, 113, 169, 0.2);
  border-top: 1px dashed rgba(4, 113, 169, 0.2);
  margin: 0;
  border-radius: 0 0 1px 1px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  padding: 0.8rem 1rem;
  background-color: rgba(249, 249, 249, 0.5);
}

.length-example.active {
  display: block;
}

.length-example::before {
  content: "COMPLETION";
  position: absolute;
  top: -0.5rem;
  right: 0.75rem;
  background-color: white;
  padding: 0 0.4rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.05em;
  z-index: 10;
  text-transform: uppercase;
}

.length-completion {
  font-family: "Geist Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.85);
  margin-bottom: 0.6rem;
}

.token-count {
  font-family: "Geist Mono", monospace;
  font-size: 0.75rem;
  color: rgba(4, 113, 169, 0.8);
  text-align: right;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.token-count span {
  font-weight: 700;
  color: var(--primary-color);
}

/*=====  Button Styles  ======*/
.generate-button {
  padding: 0.25rem 1rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--primary-color-light);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

.generate-button:hover {
  background: var(--primary-color-light);
}

.generate-button.primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.generate-button.primary:hover {
  background: var(--primary-color-dark);
  border-color: var(--primary-color-dark);
}

/*=====  SMC Particle Visualization  ======*/
.smc-visualization-section {
  margin: 2.5rem 0;
  padding: 1.75rem 1.25rem;
  background: #fafbfc;
  border: 2px solid rgba(4, 113, 169, 0.12);
}

.smc-viz-container {
  max-width: 1200px;
  margin: 0 auto;
}

.smc-diagram {
  width: 100%;
  height: auto;
  display: block;
  shape-rendering: geometricPrecision;
}

/* Particle base styles with subtle depth */
.particle-initial {
  fill: #0471a9;
  fill-opacity: 0.85;
}

.particle-weighted-large {
  fill: #034972;
  fill-opacity: 0.9;
}

.particle-weighted-medium {
  fill: #0471a9;
  fill-opacity: 0.75;
}

.particle-weighted-small {
  fill: #0471a9;
  fill-opacity: 0.25;
}

.particle-resampled {
  fill: #5a9cc6;
  fill-opacity: 0.8;
}

/* Grid with precise mathematical spacing */
.grid-line {
  stroke: #0471a9;
  stroke-width: 1;
  stroke-dasharray: 6, 6;
  opacity: 0.18;
}

.grid-line-major {
  opacity: 0.24;
}

.stage-box {
  fill: none;
  stroke: #0471a9;
  stroke-width: 2;
  stroke-dasharray: 10, 5;
  opacity: 0.3;
}

/* Typography with optical adjustments */
.stage-label {
  font-family: "Geist Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  fill: #0471a9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Arrows with perfect weight */
.arrow-main {
  stroke: #0471a9;
  stroke-width: 3;
  fill: #0471a9;
}

.arrow-weight {
  stroke: #0471a9;
  stroke-width: 1.5;
  fill: none;
  opacity: 0.5;
  stroke-dasharray: none;
}

/* Subtle enhancements */
.particle-shadow {
  fill: #000;
  opacity: 0.08;
  filter: blur(2px);
}

/*=====  Responsive Adjustments  ======*/
@media (max-width: 768px) {
  .stage-label {
    font-size: 20px;
  }
}

@media (max-width: 650px) {
  .length-control-tabs {
    flex-wrap: wrap;
  }

  .example-input,
  .example-output {
    font-size: 0.85rem;
    padding: 0.9rem 1rem;
  }
}

/*=====  Mobile Padding Optimization  ======*/

/* Tablet devices (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
  .post-content {
    padding: 1.5rem 0.75rem;  /* 25% horizontal reduction */
  }
}

/* Mobile devices (320px - 480px) */
@media (max-width: 480px) {
  .post-content {
    padding: 1.25rem 0.5rem;  /* 50% horizontal reduction as requested */
  }
}

/* Small mobile devices (< 375px) */
@media (max-width: 374px) {
  .post-content {
    padding: 1rem 0.375rem;  /* 62.5% horizontal reduction */
  }
}
