  :root {
    --highlight-color: #e91e63;
    --bg-color: #111;
    --text-color: #ffffff;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: sans-serif;
    overflow-x: hidden;
  }
  
  /* 페이지 컨테이너 여백 및 중앙 정렬 */
  main {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
  }
  
  /* 입력 모드 */
  #editorMode {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
  }
  
  h1 {
    font-size: 32px;
    text-align: center;
    margin-bottom: 20px;
  }
  
  #editorMode textarea {
    width: 100%;
    max-width: 800px;
    height: 120px;
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    border: none;
    resize: vertical;
    margin-bottom: 10px;
    color: var(--text-color);
    background: #222;
  }
  
  #controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
  }

  /* PC: colorControls horizontal layout */
  #colorControls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-left: 10px;
  }
  #colorControls label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
  }
  
  label {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  input[type=range] { 
    width: 120px; 
  }
  
  .control {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
  }
  
  .control:hover { 
    opacity: 0.9; 
  }
  
  .control:active {
    background: #444;
  }

  /* 미리보기 영역 */
  #preview {
    position: relative;
    width: 100%;
    max-width: 800px;
    font-size: 48px;
    padding: 40px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: center;
  }
  

  /* 리딩 모드 오버레이 */
  #readerOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 1000;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  /* 리딩 컨트롤 */
  #readerControls {
    position: absolute;
    top: 20px; right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  #readerControls button.control:not(#speedDown):not(#speedUp) {
    width: 120px;
  }
  
  #readSpeed {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #222;
    width: 120px;
    text-align: center;
  }

  #display {
    position: relative;
    font-size: 48px;
    padding: 40px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--text-color);
    text-align: center;
    margin: 30px 0;
  }
  
  .highlight { 
    color: var(--highlight-color); 
    font-weight: bold; 
  }

  /* Emphasis guide lines fixed in container center */
  #preview, #display {
    position: relative;
  }
  #preview::before, #preview::after,
  #display::before, #display::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: var(--highlight-color);
  }
  #preview::before, #display::before { top: 0; }
  #preview::after,  #display::after  { bottom: 0; }
  /* Maintain padding around highlighted char */
  .highlight { padding: 0.3em 0; display: inline-block; }
  
  /* 모바일 대응 */
  @media (max-width: 600px) {
    h1 {
      font-size: 20px;
      margin-bottom: 15px;
    }
    
    /* 입력 모드 반응형 */
    #editorMode { 
      padding: 15px; 
    }
    
    #editorMode textarea { 
      height: 100px; 
      font-size: 16px;
    }
    
    #controls { 
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      width: 100%;
    }
    
    input[type=range] { 
      width: 160px; 
    }
    
    .control {
      padding: 10px;
      margin: 0;
      width: 100%;
      justify-content: center;
      text-align: center;
    }
    
    /* 속도 설정 */
    label:first-of-type {
      grid-column: span 2;
      background: #333;
      border-radius: 4px;
      padding: 10px;
      justify-content: space-between;
      display: flex;
      align-items: center;
    }
    
    /* 색상 관련 레이블들을 한 줄에 */
    label:not(:first-of-type) {
      grid-column: span 2;
      background: #333;
      border-radius: 4px;
      padding: 10px;
      display: flex;
      justify-content: space-between;
    }
    
    /* 색상 입력 컨테이너 */
    #colorControls {
      grid-column: span 2;
      display: flex;
      background: #333;
      border-radius: 4px;
      padding: 10px;
      justify-content: space-between;
    }
    
    #colorControls label {
      background: transparent;
      padding: 0;
      margin: 0;
      flex: 1;
      font-size: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      grid-column: auto;
    }
    
    #colorControls input[type=color] {
      margin-top: 5px;
      width: 40px;
      height: 30px;
      border: none;
      border-radius: 4px;
    }
    
    #preview, #display { 
      font-size: 28px; 
      padding: 40px 0;
      word-break: break-all;
      margin: 30px 0;
      min-height: 120px;
    }

    /* 모바일용 하단 바 컨트롤 */
    #readerControls {
      position: fixed;
      top: auto;
      bottom: 0; 
      left: 0;
      right: 0;
      width: 100%;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: auto auto auto;
      background: rgba(17, 17, 17, 0.95);
      padding: 8px;
      gap: 4px;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    }
    
    #readerControls button.control {
      width: 100% !important;
      margin: 2px;
      padding: 8px 0;
      font-size: 14px;
    }
    
    /* 속도 조절 버튼을 한 줄에 배치 */
    #speedDown, #speedUp {
      font-size: 16px;
      font-weight: bold;
    }
    
    #speedDown {
      grid-column: 1;
      grid-row: 3;
    }
    
    #speedUp {
      grid-column: 2;
      grid-row: 3;
    }
    
    /* 속도 표시를 맨 아래 전체 너비로 */
    #readSpeed {
      grid-column: 1 / span 2;
      grid-row: 4;
      width: 100%;
      margin: 2px;
      padding: 8px 0;
      font-size: 14px;
      text-align: center;
    }
    
    /* 버튼 배치 (2x2 그리드) */
    #backEdit {
      grid-column: 1;
      grid-row: 1;
    }
    
    #readPause {
      grid-column: 2;
      grid-row: 1;
    }
    
    #readPrev {
      grid-column: 1;
      grid-row: 2;
    }
    
    #readNext {
      grid-column: 2;
      grid-row: 2;
    }
    
    /* 모바일에서 리더 모드일 때 컨텐츠 패딩 조정 */
    #readerOverlay {
      padding: 15px 15px 140px 15px; /* 하단 패딩 증가 */
    }
  }
  /* footer */
  #pageFooter {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    font-size: 14px;
    color: var(--text-color);
    background: var(--bg-color);
  }
  #pageFooter p {
    margin-bottom: 10px;
  }
  #pageFooter nav.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
  }
  #pageFooter nav.footer-menu li {
    margin-right: 20px;
  }
  #pageFooter nav.footer-menu a {
    color: var(--text-color);
    text-decoration: none;
  }
