/* --- CONVERTER VIEW --- */

.converter-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    
    /* FIX: Height handling */
    height: 100%;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    
    /* Default Padding (Desktop) */
    padding-bottom: 1rem; 
    box-sizing: border-box; /* Critical for padding to subtract from height */
}

/* Input/Output Wrappers */
.io-group {
    display: flex;
    flex-direction: column;
    /* Flex 1 allows them to grow/shrink equally to fill space */
    flex: 1; 
    /* Prevent collapsing too small, but allow shrinking */
    min-height: 0; 
    
    position: relative;
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: var(--border-width) solid var(--border-subtle);
    box-shadow: 0 4px 0 var(--border-subtle);
    transition: border-color 0.2s;
    
    /* Ensure content inside (textarea) doesn't overflow */
    overflow: hidden; 
}

.io-group:focus-within {
    border-color: var(--c-blue);
}

.io-label {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.io-textarea {
    width: 100%;
    height: 100%;
    resize: none;
    border: none;
    background: transparent;
    padding: 2.5rem 1rem 1rem 1rem; 
    font-family: var(--font-english); 
    font-size: 1.5rem; /* Unified size for both scripts */
    font-weight: 700;
    color: var(--text-main);
    outline: none;
}

/* FIX: Placeholder always stays English/Nunito */
.io-textarea::placeholder {
    font-family: var(--font-english) !important;
    opacity: 0.4;
}

/* Specific Font Overrides for CONTENT */
.font-syl {
    font-family: var(--font-syllabic);
    line-height: 1.2;
    /* REMOVED: font-size override. Now matches 1.5rem above. */
}

/* Swap Button Wrapper */
.swap-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 0; 
    z-index: 10;
}

.swap-btn {
    appearance: none;
    border: var(--border-width) solid var(--border-subtle);
    background-color: var(--bg-surface);
    color: var(--c-blue);
    width: 44px; 
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.swap-btn:active {
    transform: scale(0.9);
}

/* Copy Button */
.copy-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    appearance: none;
    background-color: var(--c-grey-50);
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
}

.copy-btn:hover {
    background-color: var(--c-blue);
    color: white;
}

.copy-btn.copied {
    background-color: var(--c-green);
    color: white;
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 767px) {
    .converter-container {
        /* PADDING FIX: 
           80px (Nav Height) + 16px (Gap) + Safe Area
           This forces the 100% height container to stop *above* the nav bar.
        */
        padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
    }
}

/* Small Landscape Tweaks */
@media (max-height: 650px) {
    .io-textarea {
        padding-top: 2rem; 
        font-size: 1.25rem;
    }
    /* REMOVED: font-syl override, so it scales down with io-textarea */
}