:root {
    /* Dark Theme (기본 다크 테마) */
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #4ecca3;
    --text-main: #ffffff;
    --text-sub: #a0a0a0;
    --accent-color: #e94560;
    --font-main: 'Inter', sans-serif;
}

/* Light Theme (밝은 테마) */
body.light-theme {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --primary-color: #2ecc71;
    --text-main: #2c3e50;
    --text-sub: #7f8c8d;
    --accent-color: #e74c3c;
}

body.light-theme .app-container {
    background: rgba(255, 255, 255, 0.3);
}

body.light-theme .modal-content {
    background: #ffffff;
}

body.light-theme .mic-btn {
    color: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    /* Prevent scroll on mobile / 모바일 스크롤 방지 */
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile first width */
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Auth Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    z-index: 60;
}
.modal.hidden { display: none; }
.modal-content {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 18px;
    border-radius: 12px;
    width: 92%;
    max-width: 420px;
}
.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-sub);
    cursor: pointer;
}
.auth-form label { display:block; margin-top:8px; font-size:0.85rem; color:var(--text-sub); }
.auth-form input { width:100%; padding:10px; margin-top:6px; border-radius:8px; border:1px solid var(--glass-border); background:transparent; color:var(--text-main); }
.auth-actions { display:flex; gap:8px; margin-top:12px; }
.auth-actions button { flex:1; padding:10px; border-radius:10px; border:none; cursor:pointer; background:var(--primary-color); color:#0b0b0b; font-weight:600; }
.social-auth { margin-top:12px; text-align:center; }
.social-btn { width:100%; padding:10px; margin-top:8px; border-radius:10px; border:none; cursor:pointer; }
.social-btn.google { background: #4285F4; color: white; }
.social-btn.apple { background: #111; color: white; }
.auth-footer { margin-top:12px; text-align:center; }
.ghost { background: transparent; border:1px solid var(--glass-border); color:var(--text-main); padding:8px 12px; border-radius:8px; cursor:pointer; }

/* Auth dropdown */
.auth-dropdown {
    position: absolute;
    right: 18px;
    top: 64px;
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 8px;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.auth-dropdown .name { font-weight:600; margin-bottom:6px; }
.auth-dropdown .provider { font-size:0.85rem; color:var(--text-sub); margin-bottom:8px; }
.auth-dropdown button { width:100%; padding:8px; border-radius:8px; border:none; cursor:pointer; background:var(--primary-color); color:#0b0b0b; font-weight:600; }
.auth-badge { display:inline-flex; align-items:center; gap:6px; }
.auth-badge .avatar { width:28px; height:28px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--primary-color); color:#0b0b0b; font-weight:700; }

/* Main Content */
main {
    flex: 1;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    /* Stretch children to full available width so input boxes match result card */
    align-items: stretch;
    gap: 12px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    max-width: 100%;
    overflow: hidden;
    justify-content: center; /* center the language selector contents */
}

select {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center select text for nicer appearance in stretched containers */
.language-selector select {
    text-align: center;
    -moz-text-align-last: center;
    text-align-last: center;
}

.mic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #1a1a2e;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.4);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-btn:active,
.mic-btn.listening {
    transform: scale(0.95);
    background: var(--accent-color);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.6);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(233, 69, 96, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0);
    }
}

#status-text {
    font-size: 0.9rem;
    color: var(--text-sub);
}

/* Loading state for status text (shows a small spinner after the text) */
.status-text-inline.loading {
    position: relative;
}
.status-text-inline.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.text-box {
    width: 100%;
    min-height: 60px;
    padding: 15px;
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.1rem;
    text-align: center;
}

/* Result Section */
.result-section {
    width: 100%;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.result-section.mic-btn:active {
    transform: scale(0.9);
}

/* Input Header - Toggle + Mic inline / 입력 헤더 */
.input-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
}

/* Input Method Toggle / 입력 방식 토글 */
.input-method-toggle {
    display: flex;
    gap: 6px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
}

.toggle-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: var(--text-sub);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    min-width: 44px;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(78, 204, 163, 0.4);
}

.toggle-btn:not(.active):hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Inline Mic Button / 인라인 마이크 버튼 */
.mic-btn-inline {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-btn-inline:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.4);
}

.mic-btn-inline.listening {
    animation: pulse 1.5s infinite;
    background: var(--accent-color);
}

.mic-btn-inline:active {
    transform: scale(0.95);
}

.status-text-inline {
    text-align: center;
    color: var(--text-sub);
    font-size: 0.85rem;
    margin: 4px 0;
}

/* Input Containers / 입력 컨테이너 */
.input-container {
    display: none;
}

.input-container.active {
    display: block;
}

#text-input-container {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

#text-input-container.active {
    display: flex;
}

#text-input-container textarea {
    width: 100%;
    padding: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    backdrop-filter: blur(10px);
}

/* Make the transcript and text input boxes visually match the result card width */
.transcript-editable,
#text-input-container textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Make transcript and text-input visually identical */
.transcript-editable,
#text-input-container textarea {
    min-height: 60px;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-sizing: border-box;
}

/* Ensure the explicit keyboard textarea (#text-input) matches the transcript box
   (override rows attribute or browser default sizing) */
#text-input {
    min-height: 60px;
    height: 60px;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-sizing: border-box;
    resize: vertical;
    font-size: 0.95rem;
    font-family: var(--font-main);
    color: var(--text-main);
}

/* compact the text-input area for a tighter layout (handled above) */

/* center the simple-mode row */
.input-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 6px;
}

#text-input-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

#text-input-container textarea::placeholder {
    color: var(--text-sub);
}

.translate-btn {
    align-self: flex-end;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), #3aa87e);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.3);
}

/* Prevent action buttons from wrapping their text */
.translate-btn, .auth-actions button, .auth-forms .social-btn, #signout-page-btn {
    white-space: nowrap;
}

/* Profile page layout tweaks */
#profile-page .modal-content {
    display: block;
    text-align: center;
}

#profile-page #profile-info p {
    margin: 6px 0;
}

/* Keep resend and refresh inline, signout centered below */
#resend-verification, #refresh-verification { display: inline-block; }
#signout-page-btn { display: block; margin: 14px auto 0; min-width: 160px; }

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.4);
}

.translate-btn:active {
    transform: translateY(0);
}

.text-box {
    margin-top: 20px;
    padding: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    min-height: 60px;
    color: var(--text-main);
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.text-box.hidden {
    display: none;
}

.transcript-editable {
    width: 100%;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.95rem;
    resize: vertical;
    margin-top: 6px;
    box-sizing: border-box;
}

.transcript-editable:focus {
    outline: none;
    border-color: var(--primary-color);
}

.transcript-editable.hidden {
    display: none;
}

.retranslate-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--primary-color);
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    margin-left: auto;
}

.retranslate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 204, 163, 0.4);
}

.retranslate-btn.hidden {
    display: none;
}

.result-section.hidden {
    opacity: 0;
    pointer-events: none;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    /* Prevent wrapping */
}

.category-tag {
    background: rgba(78, 204, 163, 0.2);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    /* Keep tag on one line */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.card-actions {
    display: flex;
    flex-shrink: 0;
    /* Don't shrink actions */
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1.1rem;
    /* Smaller icon */
    cursor: pointer;
    margin-left: 6px;
    padding: 6px 10px;
    /* Compact padding */
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Logo Icon */
.custom-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
}

.action-btn:hover {
    background: var(--primary-color);
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 204, 163, 0.3);
}

.action-btn:active {
    transform: scale(0.95);
}

#translated-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.sub-text {
    color: var(--text-sub);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 15px;
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 15px 0;
}

.info-block {
    margin-bottom: 10px;
}

.label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modal */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--glass-bg);
    color: var(--text-main);
    width: 92%;
    max-width: 640px;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--glass-border);
}

/* Wider panels for sign-in and profile pages to match Settings layout */
#signin-page .modal-content,
#profile-page .modal-content,
.settings-main .modal-content {
    max-width: 720px;
    width: 96%;
    padding: 22px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-sub);
}

.setting-item select,
.setting-item input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
}

.note {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 5px;
}

.api-note {
    background: rgba(78, 204, 163, 0.1);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    margin-top: 10px;
    line-height: 1.6;
}

.api-note strong {
    color: var(--primary-color);
}

/* Page Navigation System / 페이지 네비게이션 시스템 */
.page {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 90px;
    /* Extra padding for bottom nav */
}

.page.active {
    display: block;
}

/* Bottom Navigation / 하단 네비게이션 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    transition: all 0.2s;
    border-radius: 12px;
}

.nav-btn i {
    font-size: 1.3rem;
}

.nav-btn span {
    font-size: 0.75rem;
}

.nav-btn.active {
    color: var(--primary-color);
    background: rgba(78, 204, 163, 0.1);
}

.nav-btn:hover {
    color: var(--text-main);
}

/* Settings Page / 설정 페이지 */
.settings-main,
.history-main {
    padding: 20px;
    padding-bottom: 80px;
    /* Extra space for bottom nav */
    max-width: 600px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-main);
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-group {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(20px);
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.settings-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.settings-group-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-group-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.setting-item select,
.setting-item input[type="password"],
.setting-item input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s;
    min-width: 100%;
    /* Ensure full width */
}

.setting-item select:focus,
.setting-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(78, 204, 163, 0.1);
}

.setting-item select:hover,
.setting-item input:hover {
    border-color: rgba(78, 204, 163, 0.5);
}

/* Save Confirmation Toast / 저장 확인 토스트 */
.save-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    pointer-events: none;
}

.save-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.setting-item label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Color Preview / 색상 미리보기 */
.color-preview-container {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    /* Keep all previews on a single line so the default/mint preview appears next to the others */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background-clip: padding-box !important;
    flex: 0 0 auto; /* don't grow or shrink; keep fixed size */
}

.color-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-preview.active {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Explicit backgrounds for each color tone */
.color-preview[data-tone="default"] {
    /* Use two mint shades for the default preview so it reflects the Mint theme
       instead of blending with the accent color which can look jarring. */
    background: linear-gradient(135deg, #4ecca3, #3aa87e) !important;
}

.color-preview[data-tone="blue"] {
    background: linear-gradient(135deg, #4A90E2, #50C9FF) !important;
}

.color-preview[data-tone="purple"] {
    background: linear-gradient(135deg, #9B59B6, #E74C3C) !important;
}

.color-preview[data-tone="pink"] {
    background: linear-gradient(135deg, #FF6B9D, #FFC371) !important;
}

.color-preview[data-tone="orange"] {
    background: linear-gradient(135deg, #FF6348, #FFAB6B) !important;
}

.color-preview[data-tone="green"] {
    background: linear-gradient(135deg, #26de81, #20bf6b) !important;
}

.placeholder-text {
    text-align: center;
    color: var(--text-sub);
    margin-top: 40px;
    font-size: 1.1rem;
}

.hidden {
    display: none !important;
}

/* History Page */
.history-main {
    gap: 14px;
}

.history-guard {
    border: 1px dashed var(--glass-border);
    padding: 16px;
    border-radius: 14px;
}

.history-guard .guard-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.history-guard .guard-desc {
    color: var(--text-sub);
    margin-bottom: 6px;
}

.history-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px;
}

.history-filters {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.history-filters .control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-filters label {
    font-size: 0.85rem;
    color: var(--text-sub);
}

.history-bulk-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.history-empty {
    text-align: center;
    color: var(--text-sub);
    padding: 12px 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
    background: var(--glass-bg);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.history-top {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.history-meta {
    color: var(--text-sub);
    font-size: 0.85rem;
}

.history-time {
    color: var(--text-sub);
    font-size: 0.8rem;
}

.history-body {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-source {
    color: var(--text-main);
    font-weight: 600;
}

.history-target {
    color: var(--text-sub);
    font-size: 0.95rem;
}

.history-lang-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.history-flags {
    font-size: 1rem;
}

.history-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.history-actions .left-actions,
.history-actions .right-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-actions .right-actions {
    margin-left: auto;
}

.history-actions .left-actions .ghost.small {
    background: rgba(255,255,255,0.08);
}

.pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0b0b0b;
}

.pill-translate { background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); }
.pill-copy { background: rgba(255,255,255,0.2); border: 1px solid var(--glass-border); color: var(--text-main); }
.pill-listen { background: var(--accent-color); }

.ghost.small {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.ghost.small.danger {
    border-color: rgba(233, 69, 96, 0.5);
    color: #e94560;
}

.ghost.block {
    width: 100%;
    text-align: center;
}

.activity-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.activity-chip {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.history-detail {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.03);
}

.history-detail .label {
    font-size: 0.85rem;
    color: var(--text-sub);
}

.history-detail .examples {
    margin-top: 6px;
    color: var(--text-sub);
    font-size: 0.9rem;
}
