 * {
        -webkit-tap-highlight-color: transparent;
    }
    body {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 16px;
        line-height: 1.5;
        color: #000000;
        background-color: #FFFFFF;
        margin: 0 auto;
        max-width: 960px;
        padding: 20px;
        box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
    }
    h1, h2, h3 {
        font-family: "Times New Roman", Times, serif;
    }
    h1 {
        text-align: center;
    }
    a {
        color: #0000FF;
        text-decoration: underline;
    }
    hr {
        border: 0;
        height: 1.5px;
        background: #000;
        margin: 20px 0;
    }
    .tool-container {
        border: 1.5px solid #000000;
        padding: 20px;
        background-color: #F0F0F0;
    }
    .notepad-container {
        display: flex;
        flex-direction: column;
        height: 500px;
        width: 100%;
        background-color: #f8f8f8;
        border: 1.5px solid #000;
        overflow: hidden;
        position: relative;
    }
    .ribbon {
        background-color: #E0E0E0;
        color: #000;
        padding: 8px 8px;
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        z-index: 999;
        border-bottom: 1.5px solid #000;
        overflow-x: auto;
    }
    .ribbon .ribbon-group {
        display: flex;
        gap: 0;
    }
    .ribbon-group-separator {
        border-left: 1.5px solid #B0B0B0;
        margin: 0 4px;
    }
    .icon-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        font-size: 18px;
        background-color: #E0E0E0;
        border-radius: 4px;
        user-select: none;
        color: #000;
        position: relative;
        margin-right: 2px;
    }
.dialog-header .icon-button {border: 1.5px solid #000; width: 30px;height: 30px;}
    .icon-button:hover {
        background-color: #D0D0D0;
    }
    .icon-button .fa-icon {
        font-size: 20px;
    }
    .dialog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0px;
    }
/* CSS */
#editor {
  display: block;
  box-sizing: border-box;

  width: 100%;
  max-width: 100%;
  min-width: 0;           /* IMPORTANT if textarea is inside a flex container */
flex-grow: 1;
  padding: 10px;
  border: none;
  outline: none;
  resize: none;

  font-size: 16px;
  line-height: 1.7;
  background-color: #f8f8f8;
  color: #000 !default;
  caret-color: #000;

  /* Wrapping behaviour */
  white-space: pre-wrap;      /* keep existing newlines, allow wrapping */
  word-wrap: break-word;      /* legacy */
  overflow-wrap: break-word;  /* standard - break long words/URLs when necessary */

  /* Scrolling / overflow */
  overflow-x: hidden;         /* hide horizontal scroll */
  overflow-y: auto;           /* vertical scroll if content grows */
}
    .status-bar {
        background-color: #E0E0E0;
        color: #000;
        padding: 8px 12px;
        font-size: 14px;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        border-top: 1.5px solid #000;
    }
    .home-link {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        color: #0000FF;
        cursor: pointer;
    }
    .info-section {
        margin-top: 0;
    }
    .info-section h2, .info-section h3 {
        text-align: left;
    }
    .info-section p {
        text-align: left;
    }
    .info-section ul li {
        margin-top: 12px;
    }
    .info-section ol li {
        margin-top: 12px;
    }

    /* Dialogs styling */
    .dialog-box {
        display: none;
        position: absolute;
        background-color: #F0F0F0;
        z-index: 1002;
        border: 1.5px solid #000;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        box-sizing: border-box;
        /* Centering */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: calc(100% - 40px); /* Adjust based on body padding */
        max-height: calc(100% - 40px); /* Adjust based on body padding */
        width: 300px; /* Default width */
    }

    #replaceDialog, #saveDialog, #hslDialog {
        width: 300px; /* Standard width for these dialogs */
        height: auto; /* Auto height */
        padding: 15px;
        padding-top: 0px;
    }

    #hslDialog {
        width: 280px; /* Slightly smaller to fit canvas and controls */
    }

    #replaceDialog input, #saveDialog input { 
        width: 100%; 
        padding: 8px; 
        margin-bottom: 16px; 
        margin-top: 8px;
        border: 1.5px solid #000; 
        background-color: #f8f8f8; 
        color: #000; 
        border-radius: 4px; 
        font-size: 14px; 
        box-sizing: border-box; 
    }
    #replaceDialog .button-group, #saveDialog .button-group, #hslDialog .button-group { 
        display: flex; 
        margin-top: 4px; 
        gap: 8px; 
        justify-content: flex-end; 
    }
    
    /* New button styles */
    .save-btn { 
        padding: 8px 12px; 
        border: 1px solid #000; 
        cursor: pointer; 
        border-radius: 4px; 
        font-size: 13px; 
        background-color: #449d44; 
        color: #fff; 
    }
    .close-btn { 
        padding: 8px 12px; 
        border: 1px solid #000; 
        cursor: pointer; 
        border-radius: 4px; 
        font-size: 13px; 
        background-color: #C9302C; /* Red color */
        color: #fff; 
    }

    #shortcutsDialog table { 
        width: 100%; 
        border-collapse: separate;
        border-spacing: 12px;
        margin-bottom: 8px;
        font-size: 12px;
    }
    #shortcutsDialog th, #shortcutsDialog td { 
        border: 1.5px solid black;
        padding: 8px;
        text-align: center;
        min-width: 60px;
    }
    #shortcutsDialog th { background-color: #C0C0C0; }
    #hslCanvas { width: 100%; height: 20px; cursor: pointer; border-radius: 4px; border: 1.5px solid #ccc; margin-bottom: 12px;}
    .hsl-controls input[type="range"] { width: 100%; height: 20px; background: #ddd; outline: none; border-radius: 4px; }
    #hslPreview { width: 50px; height: 50px; border: 2px solid #ccc; margin: 8px auto 0; border-radius: 4px; margin-bottom: 20px;}
    
    /* Original Dropdown Styles */
    #font-styles-dropdown, #font-sizes-dropdown {
        display: none;
        position: absolute;
        margin-top: -15px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #F0F0F0;
        padding: 15px;
        z-index: 1002;
        border: 1.5px solid #C0C0C0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
    }
    .dropdown-item {
        padding: 10px 15px;
        cursor: pointer;
        color: #000;
        font-size: 16px;
    }
.dropdown h3 {margin-bottom: 10px;}
.dropdown .icon-button {margin-bottom: 0px; margin-top: 4px; border: 1.5px solid #000; width: 30px; height: 30px;}
    .dropdown-item:hover {
        background-color: #D0D0D0;
    }
    @media (max-width: 767px) {
        body { padding: 20px; }
        .notepad-container { height: 550px;}
        .ribbon {
            justify-content: flex-start;
        }
        .icon-button {
            width: 40px;
            height: 40px;
        }
        .icon-button .fa-icon {
            font-size: 18px;
        }
        .dialog-box {
            max-width: calc(100% - 20px);
            max-height: calc(100% - 20px);
            width: 90%; /* Adjust for smaller screens */
        }
    }