  :root{
    --ink: #1c2530;
    --ink-2: #26313f;
    --ink-3: #313e4e;
    --paper: #fdfcfa;
    --paper-border: #e6e2d6;
    --accent: #b8860b;
    --accent-bright: #d9a53c;
    --accent-soft: #f6ecd3;
    --text: #1c2530;
    --muted: #6b7280;
    --code-bg: #10151d;
    --code-text: #e8c876;
  }

  *{ box-sizing: border-box; }



  .section-box{
    background: transparent;
    padding: 0;
  }

  /* TOOLBAR */
  .toolbar{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px;
    margin-bottom: 16px;
    background: var(--ink);
    border-radius: 8px;
  }

  .tool-btn{
    min-width: 38px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: var(--ink-2);
    color: #e9e4d6;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .tool-btn:hover{
    background: var(--ink-3);
    border-color: var(--accent);
    color: var(--accent-bright);
  }
  .tool-btn.b{ font-weight: 700; }
  .tool-btn.i{ font-style: italic; }
  .tool-divider{
    width: 1px;
    align-self: stretch;
    background: var(--ink-3);
    margin: 4px 2px;
  }

  /* EDITOR */
  .editor-wrap{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  @media (max-width: 900px){
    .editor-wrap{ grid-template-columns: 1fr; }
  }

  .pane-head{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
  }

  .box-title{
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
  }

  .pane-tag{
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: 20px;
  }

  /* TEXTAREA */
  textarea{
    width: 100%;
    height: 500px;
    padding: 18px;
    border: 1px solid var(--paper-border);
    border-radius: 8px;
    resize: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    box-sizing: border-box;
    background: #fffefb;
    color: var(--text);
  }
  textarea:focus{
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184,134,11,0.12);
  }

  /* PREVIEW */
  .preview{
    height: 500px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--paper-border);
    border-radius: 8px;
    padding: 26px 30px;
    line-height: 1.75;
    word-break: break-word;
    font-family: 'Source Serif 4', serif;
    font-size: 16px;
    color: var(--text);
  }

  .preview h1, .preview h2, .preview h3{
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    line-height: 1.25;
  }
  .preview h1{
    font-size: 30px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-soft);
  }
  .preview h2{ font-size: 24px; margin: 24px 0 10px; }
  .preview h3{ font-size: 19px; margin: 20px 0 8px; }
  .preview p{ margin: 0 0 14px; }

  .preview code{
    background: var(--accent-soft);
    color: #6b4c05;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
  }

  .preview pre{
    background: var(--code-bg);
    color: var(--code-text);
    padding: 16px 18px;
    border-radius: 8px;
    overflow: auto;
    margin: 0 0 16px;
  }
  .preview pre code{
    background: none;
    color: inherit;
    padding: 0;
    font-size: 13px;
  }

  .preview blockquote{
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    padding: 10px 16px;
    color: #4a4030;
    margin: 0 0 16px;
    border-radius: 0 6px 6px 0;
    font-style: italic;
  }

  .preview ul{
    padding-left: 22px;
    margin: 0 0 16px;
  }
  .preview li{ margin-bottom: 4px; }

  .preview hr{
    border: none;
    border-top: 1px solid var(--paper-border);
    margin: 22px 0;
  }

  .preview a{
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-soft);
    text-underline-offset: 2px;
  }

  .preview:empty::before{
    content: "Preview will appear here...";
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    font-style: normal;
  }

  /* STATUS BAR */
  .statusbar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding: 10px 14px;
    background: #f6f4ee;
    border: 1px solid var(--paper-border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
    gap: 8px;
  }
  .statusbar .stats{
    display: flex;
    gap: 16px;
    font-family: 'JetBrains Mono', monospace;
  }
  .statusbar .stats b{ color: var(--ink); }

  /* BUTTONS */
  .btns{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
  }

  .app{
    padding: 11px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    transition: filter 0.15s ease;
  }
  .app:hover{ filter: brightness(1.08); }

  .green{
    background: linear-gradient(135deg, #2f7a4f, #1f5c3a);
    color: #fff;
  }
  .gray{
    background: #e7e4d9;
    color: var(--ink);
  }