/* ============================================================
   CHARACTERS TO WORDS
   characters-to-words.css
   ============================================================ */


/* ============================================================
   BASE PAGE
   ============================================================ */

html {
    margin: 0;
    padding: 0;
    border: none;
    font-family: Arial, sans-serif;
}


.ctw-page {
    width: 100%;
    padding: 105px 15px 30px;
    color: #333;
    font-family: Arial, sans-serif;
}


.ctw-page *,
.ctw-page *::before,
.ctw-page *::after {
    box-sizing: border-box;
}


.ctw-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


.ctw-main {
    min-width: 0;
}


.ctw-tool-section {
    width: 100%;
}


.ctw-page button,
.ctw-page input {
    font-family: Arial, sans-serif;
}


.ctw-page a {
    color: #1155cc;
    text-decoration: none;
}


.ctw-page a:hover {
    text-decoration: underline;
}


/* ============================================================
   PAGE HEADING
   ============================================================ */

.ctw-heading {
    margin-bottom: 22px;
    text-align: center;
}


.ctw-heading h1 {
    margin: 0 0 10px;
    padding: 0;
    color: #333;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;
}


.ctw-intro {
    max-width: 760px;
    margin: 0 auto;
    color: #555;
    font-size: 17px;
    line-height: 1.55;
}


/* ============================================================
   MAIN CONVERTER CARD
   ============================================================ */

.ctw-converter-card {
    width: 100%;
    padding: 20px;
    border: 1px solid #d9dde3;
    border-radius: 10px;
    background: #fff;
}


/* ============================================================
   MAIN CONVERSION ROW
   ============================================================ */

.ctw-converter-main-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        34px
        minmax(0, 1fr);

    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-bottom: 18px;
}


/* ============================================================
   INPUT / RESULT CARDS
   ============================================================ */

.ctw-input-card,
.ctw-result-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 158px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #cfd7e3;
    border-radius: 10px;
    background: #fff;
}


.ctw-result-card {
    overflow: visible;
    text-align: center;
}


/* ============================================================
   CARD TITLES
   ============================================================ */

.ctw-card-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #cfd7e3;
    border-radius: 9px 9px 0 0;
    background: #eef5ff;
    color: #333;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
}


/* ============================================================
   INPUT AREA
   ============================================================ */

.ctw-input-area {
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
    min-width: 0;
}


.ctw-conversion-input {
    display: block;
    flex: 1;
    width: calc(100% - 30px);
    min-width: 0;
    height: 68px;
    margin: 19px 15px;
    padding: 10px 15px;
    border: 2px solid #aeb4bd;
    border-radius: 8px;
    background: #fff;
    color: #222;
    outline: none;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 700;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.ctw-conversion-input:hover {
    border-color: #8f969f;
}


.ctw-conversion-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}


.ctw-conversion-input::placeholder {
    color: #8d949e;
    opacity: 1;
    font-size: 20px;
    font-weight: 400;
}


.ctw-conversion-input::-webkit-outer-spin-button,
.ctw-conversion-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}


.ctw-conversion-input[type="number"] {
    -moz-appearance: textfield;
}


/* ============================================================
   INPUT MESSAGE
   ============================================================ */

.ctw-input-message {
    margin: -8px 15px 12px;
    min-height: 0;
    color: #c62828;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
}


.ctw-input-message:empty {
    display: none;
}


/* ============================================================
   CONVERSION ARROW
   ============================================================ */

.ctw-converter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: #7a828c;
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    user-select: none;
}


/* ============================================================
   MAIN RESULT
   ============================================================ */

.ctw-primary-result {
    display: block;
    max-width: 100%;
    margin: 17px 15px 0;
    color: #1a73e8;
    font-size: 39px;
    line-height: 1;
    font-weight: 700;
    overflow-wrap: anywhere;
}


/* ============================================================
   RESULT BASIS
   ============================================================ */

.ctw-result-basis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    width: calc(100% - 28px);
    margin: 8px 14px 14px;
    color: #6a6f76;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}


/* ============================================================
   OPTION GROUPS
   ============================================================ */

.ctw-option-group {
    width: 100%;
    margin: 0 0 18px;
}


.ctw-option-label {
    display: block;
    margin-bottom: 8px;
    color: #444;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
}


.ctw-option-row {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin: 0;
}


.ctw-option {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex: 0 1 205px;
    min-width: 0;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #d5d9df;
    border-radius: 7px;
    background: #fff;
    color: #444;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    cursor: pointer;
    user-select: none;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}


.ctw-option:hover {
    border-color: #aeb4bd;
    background: #fafafa;
}


.ctw-option:has(input:checked) {
    border-color: #1a73e8;
    background: #f5f9ff;
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.08);
}


.ctw-option input[type="radio"] {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #1a73e8;
    cursor: pointer;
}


.ctw-option-help {
    margin: 9px 0 0;
    color: #6b7078;
    font-size: 13px;
    line-height: 1.45;
}


/* ============================================================
   PAGE ESTIMATE CARD
   ============================================================ */

.ctw-pages-card {
    width: 100%;
    margin-top: 4px;
    overflow: hidden;
    border: 1px solid #d5d9df;
    border-radius: 8px;
    background: #fff;
}


/* ============================================================
   PAGE ESTIMATE SUMMARY
   ============================================================ */

.ctw-pages-summary {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    max-width: 100%;
    padding: 14px 16px;
}


.ctw-pages-text {
    flex: 0 1 auto;
    width: 205px;
    min-width: 0;
}


.ctw-secondary-label {
    display: block;
    margin-bottom: 3px;
    color: #444;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
}


.ctw-secondary-description {
    display: block;
    max-width: 205px;
    color: #70757d;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
}


.ctw-secondary-value {
    flex: 0 0 auto;
    color: #1a73e8;
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    text-align: left;
}


/* ============================================================
   WORDS TO PAGES RECOMMENDATION
   ============================================================ */

.ctw-pages-recommendation {
    width: 100%;
    padding: 13px 16px;
    border-top: 1px solid #e1e5ea;
    background: #f7faff;
}


.ctw-pages-recommendation p {
    margin: 0;
    color: #444;
    font-size: 14px;
    line-height: 1.55;
}


.ctw-pages-recommendation a {
    color: #1155cc;
    text-decoration: none;
}


.ctw-pages-recommendation a:hover {
    text-decoration: underline;
}


/* ============================================================
   QUICK REFERENCE SECTION
   ============================================================ */

.ctw-reference-section {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #d9dde3;
    border-radius: 10px;
    background: #fff;
}


.ctw-reference-header {
    margin-bottom: 16px;
}


.ctw-reference-header h2 {
    margin: 0 0 5px;
    padding: 0;
    color: #333;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
}


.ctw-reference-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}


/* ============================================================
   CONVERSION TABLE
   ============================================================ */

.ctw-reference-table-wrapper {
    width: 100%;
    overflow-x: auto;
}


.ctw-reference-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #333;
    font-size: 14px;
}


.ctw-reference-table th,
.ctw-reference-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #e2e5e9;
    text-align: center;
    vertical-align: middle;
}


.ctw-reference-table th {
    background: #f4f5f7;
    color: #444;
    font-weight: 700;
    white-space: nowrap;
}


.ctw-reference-table tbody tr:last-child td {
    border-bottom: none;
}


.ctw-reference-table tbody tr:nth-child(even) {
    background: #fafafa;
}


.ctw-reference-table tbody tr:hover {
    background: #f5f9ff;
}


.ctw-reference-table td:first-child {
    font-weight: 600;
}


.ctw-reference-table td:last-child {
    color: #1a73e8;
    font-weight: 700;
}


/* ============================================================
   INFORMATIONAL CONTENT
   ============================================================ */

.ctw-content {
    width: 100%;
    margin-top: 28px;
    color: #333;
    font-size: 17px;
    line-height: 1.65;
}


.ctw-content h2 {
    margin: 32px 0 12px;
    padding: 0;
    color: #333;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 700;
}


.ctw-content h2:first-child {
    margin-top: 0;
}


.ctw-content h3 {
    margin: 22px 0 8px;
    padding: 0;
    color: #333;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 700;
}


.ctw-content p {
    margin: 0 0 16px;
}


.ctw-content strong {
    font-weight: 700;
}


/* ============================================================
   EXAMPLE BOX
   ============================================================ */

.ctw-example-box {
    width: 100%;
    margin: 18px 0 24px;
    padding: 16px 18px;
    border-left: 4px solid #1a73e8;
    border-radius: 0 7px 7px 0;
    background: #f7faff;
}


.ctw-example-box h3 {
    margin: 0 0 10px;
    font-size: 18px;
}


.ctw-example-box p {
    margin: 5px 0;
}


.ctw-example-result {
    margin-top: 11px !important;
}


/* ============================================================
   COMMON CHARACTER COUNTS
   ============================================================ */

.ctw-common-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 16px 0 28px;
}


.ctw-common-card {
    margin: 0;
    padding: 15px 16px;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    background: #fff;
}


.ctw-common-card h3 {
    margin: 0 0 7px;
    color: #333;
    font-size: 17px;
    line-height: 1.4;
}


.ctw-common-card p {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.55;
}


.ctw-common-card strong {
    color: #1a73e8;
}


/* ============================================================
   FAQ
   ============================================================ */

.ctw-faq-list {
    width: 100%;
    margin-top: 8px;
}


.ctw-faq-item {
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid #e1e4e8;
}


.ctw-faq-item:first-child {
    padding-top: 0;
}


.ctw-faq-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}


.ctw-faq-item h3 {
    margin: 0 0 7px;
    color: #333;
    font-size: 18px;
    line-height: 1.4;
}


.ctw-faq-item p {
    margin: 0;
}


/* ============================================================
   RELATED TOOLS
   ============================================================ */

.ctw-related-tools {
    width: 100%;
    margin-top: 32px;
    padding: 18px 20px;
    border: 1px solid #d6dde7;
    border-radius: 8px;
    background: #f7faff;
}


.ctw-related-tools h2 {
    margin: 0 0 10px;
    color: #333;
    font-size: 22px;
    line-height: 1.3;
}


.ctw-related-tools p {
    margin: 0 0 12px;
}


.ctw-related-tools p:last-child {
    margin-bottom: 0;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.ctw-sidebar,
#sidebar {
    width: 300px;
    min-width: 300px;
    min-height: 600px;
    text-align: center;
}


/* ============================================================
   OLDER POSTS
   ============================================================ */

.older-posts {
    margin-top: 0;
}


/* ============================================================
   RESPONSIVE — DESKTOP / MEDIUM
   ============================================================ */

@media only screen and (max-width: 1100px) {

    .ctw-page {
        padding-left: 12px;
        padding-right: 12px;
    }


    .ctw-page-layout {
        gap: 20px;
    }


    .ctw-heading h1 {
        font-size: 30px;
    }


    .ctw-conversion-input {
        font-size: 25px;
    }


    .ctw-primary-result {
        font-size: 36px;
    }

}


/* ============================================================
   RESPONSIVE — HIDE SIDEBAR
   ============================================================ */

@media only screen and (max-width: 900px) {

    .ctw-page-layout {
        display: block;
        max-width: 820px;
    }


    .ctw-sidebar,
    #sidebar {
        display: none;
    }

}


/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media only screen and (max-width: 700px) {

    .ctw-page {
        padding-top: 90px;
    }


    .ctw-heading h1 {
        font-size: 28px;
    }


    .ctw-intro {
        font-size: 16px;
    }


    .ctw-converter-card {
        padding: 16px;
    }


    .ctw-card-title {
        font-size: 18px;
    }


    .ctw-conversion-input {
        font-size: 23px;
    }


    .ctw-conversion-input::placeholder {
        font-size: 17px;
    }


    .ctw-primary-result {
        font-size: 34px;
    }


    .ctw-content {
        font-size: 16px;
    }


    .ctw-content h2 {
        font-size: 24px;
    }


    .ctw-common-grid {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   RESPONSIVE — STACK MAIN CARDS
   ============================================================ */

@media only screen and (max-width: 560px) {

    .ctw-page {
        padding-left: 9px;
        padding-right: 9px;
    }


    .ctw-converter-main-row {
        grid-template-columns: 1fr;
        gap: 9px;
    }


    .ctw-converter-arrow {
        min-height: 26px;
        transform: rotate(90deg);
        font-size: 24px;
    }


    .ctw-input-card,
    .ctw-result-card {
        min-height: 145px;
    }


    .ctw-card-title {
        min-height: 46px;
        font-size: 18px;
    }


    .ctw-conversion-input {
        width: calc(100% - 26px);
        height: 62px;
        margin: 17px 13px;
        font-size: 22px;
    }


    .ctw-primary-result {
        margin-top: 16px;
        font-size: 34px;
    }


    .ctw-option-row {
        flex-direction: column;
    }


    .ctw-option {
        flex: 1 1 auto;
        width: 100%;
    }


    .ctw-pages-summary {
        gap: 12px;
        padding: 13px 14px;
    }


    .ctw-pages-text {
        width: 190px;
    }


    .ctw-secondary-description {
        max-width: 190px;
    }


    .ctw-secondary-value {
        font-size: 25px;
    }


    .ctw-pages-recommendation {
        padding: 12px 14px;
    }


    .ctw-reference-section {
        padding: 16px;
    }


    .ctw-reference-header h2 {
        font-size: 20px;
    }


    .ctw-content h2 {
        font-size: 22px;
    }


    .ctw-related-tools {
        padding: 15px;
    }

}


/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media only screen and (max-width: 420px) {

    .ctw-heading h1 {
        font-size: 25px;
    }


    .ctw-converter-card {
        padding: 13px;
    }


    .ctw-card-title {
        font-size: 17px;
    }


    .ctw-conversion-input {
        font-size: 20px;
    }


    .ctw-conversion-input::placeholder {
        font-size: 15px;
    }


    .ctw-primary-result {
        font-size: 31px;
    }


    .ctw-option-label {
        font-size: 16px;
    }


    .ctw-option {
        font-size: 13px;
    }


    .ctw-pages-summary {
        gap: 10px;
        padding: 12px;
    }


    .ctw-pages-text {
        width: 170px;
    }


    .ctw-secondary-label {
        font-size: 14px;
    }


    .ctw-secondary-description {
        max-width: 170px;
        font-size: 11px;
    }


    .ctw-secondary-value {
        font-size: 23px;
    }


    .ctw-pages-recommendation {
        padding: 11px 12px;
    }


    .ctw-pages-recommendation p {
        font-size: 13px;
    }


    .ctw-reference-table {
        min-width: 360px;
    }


    .ctw-reference-table th,
    .ctw-reference-table td {
        padding: 10px 8px;
        font-size: 13px;
    }


    .ctw-content {
        font-size: 15px;
    }


    .ctw-common-card p {
        font-size: 14px;
    }

}


/* ============================================================
   VERY SMALL SCREENS
   ============================================================ */

@media only screen and (max-width: 350px) {

    .ctw-heading h1 {
        font-size: 23px;
    }


    .ctw-primary-result {
        font-size: 28px;
    }


    .ctw-pages-summary {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        width: 100%;
    }


    .ctw-pages-text {
        width: 100%;
    }


    .ctw-secondary-description {
        max-width: 205px;
    }


    .ctw-secondary-value {
        text-align: left;
    }

}