html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5I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I2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ?? Auth pages ??????????????????????????????????????????????? */
.auth-container {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, #eef2ff 0%, #f5f7ff 60%, #e8f3fd 100%);
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(3, 23, 61, 0.10);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 430px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ea-primary) 0%, var(--ea-accent) 100%);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #03173d;
}

/* Auth brand header */
.ea-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .65rem;
    margin-bottom: .5rem;
}

.ea-auth-favicon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.ea-auth-wordmark {
    max-height: 34px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.ea-auth-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: .9rem;
    margin-bottom: 1.5rem;
}

/* Google button wrapper — lets renderButton fill the full width */
.ea-google-btn-wrapper {
    width: 100%;
    min-height: 44px;
    display: flex;
    justify-content: center;
    margin-bottom: .25rem;
}
.ea-google-btn-wrapper > div,
.ea-google-btn-wrapper iframe {
    width: 100% !important;
}

/* Auth divider "— o —" */
.ea-auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
    color: #adb5bd;
    font-size: .85rem;
}
.ea-auth-divider::before,
.ea-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dee2e6;
}

/* ?? EmotionAsist UI ???????????????????????????????????????????????? */
:root {
    --ea-primary: #03173d;
    --ea-accent: #4f7cff;
    --ea-bg: #f5f7ff;
    --ea-card: #ffffff;
    --ea-radius: 0.875rem;
}

.ea-btn-primary {
    background: var(--ea-primary);
    color: #fff;
    border: none;
    border-radius: var(--ea-radius);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    transition: opacity .15s;
}
.ea-btn-primary:hover { background: #0a2855; color: #fff; opacity: 1; }
.ea-btn-primary:focus { background: #0a2855; color: #fff; opacity: 1; outline: none; }
.ea-btn-primary:disabled { opacity: .55; }

/* Dashboard */
.ea-dashboard { max-width: 720px; margin: 0 auto; }

.ea-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.ea-welcome h2 { margin: 0; font-size: 1.4rem; }

.ea-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.ea-stat-card {
    background: var(--ea-card);
    border-radius: var(--ea-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ea-stat-number { font-size: 1.5rem; font-weight: 700; color: var(--ea-primary); }
.ea-stat-label  { font-size: .75rem; color: #6c757d; margin-top: .15rem; }

/* Entry cards */
.ea-entries-list { display: flex; flex-direction: column; gap: .6rem; }

.ea-entry-card {
    background: var(--ea-card);
    border-radius: var(--ea-radius);
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: box-shadow .15s;
}
.ea-entry-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.ea-entry-card.expanded { border-left: 3px solid var(--ea-accent); }

.ea-entry-emoji { font-size: 2rem; flex-shrink: 0; }
.ea-entry-info  { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.ea-entry-note  { font-size: .8rem; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.ea-entry-intensity { display: flex; gap: .2rem; flex-shrink: 0; }
.ea-dot { width: 8px; height: 8px; border-radius: 50%; background: #dee2e6; }
.ea-dot.active { background: var(--ea-accent); }

/* Empty state */
.ea-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}
.ea-empty span { font-size: 3rem; }

/* New entry form */
.ea-form-page { max-width: 560px; margin: 0 auto; }
.ea-form-header { margin-bottom: 1.5rem; }
.ea-form-header h3 { margin: .5rem 0 .25rem; }

.ea-btn-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    transition: color .15s, gap .15s;
}
.ea-btn-back:hover {
    color: var(--ea-primary);
    gap: .5rem;
    text-decoration: none;
}

.ea-emotion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.ea-emotion-btn {
    background: var(--ea-card);
    border: 2px solid #e9ecef;
    border-radius: var(--ea-radius);
    padding: .75rem .5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    cursor: pointer;
    transition: border-color .15s, transform .1s;
}
.ea-emotion-btn:hover { border-color: var(--ea-accent); transform: translateY(-2px); }
.ea-emotion-btn.selected { border-color: var(--ea-accent); background: #eef2ff; }
.ea-emotion-icon { font-size: 1.8rem; }
.ea-emotion-name { font-size: .72rem; font-weight: 600; color: #444; }

.ea-intensity-section { margin-bottom: 1.25rem; }
.ea-intensity-row { display: flex; gap: .5rem; }
.ea-intensity-btn {
    flex: 1;
    border: 2px solid #dee2e6;
    background: var(--ea-card);
    border-radius: .5rem;
    padding: .5rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color .15s;
}
.ea-intensity-btn.selected { border-color: var(--ea-accent); background: #eef2ff; color: var(--ea-accent); }

/* Analysis result */
.ea-analysis-result { display: flex; flex-direction: column; gap: 1rem; }
.ea-result-header { display: flex; align-items: center; gap: 1rem; }
.ea-result-emoji { font-size: 3rem; }
.ea-intensity-dots { display: flex; gap: .3rem; margin-top: .3rem; }

.ea-analysis-card {
    background: var(--ea-bg);
    border-radius: var(--ea-radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ea-analysis-section h6 { color: var(--ea-primary); margin-bottom: .25rem; }
.ea-analysis-section p { margin: 0; color: #444; }

.ea-affirmation {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 0 .5rem .5rem 0;
    padding: .75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    color: #5a4a00;
    font-style: italic;
}

/* Analysis inline (historial) */
.ea-analysis-inline {
    background: var(--ea-bg);
    border-radius: 0 0 var(--ea-radius) var(--ea-radius);
    padding: 1rem 1.25rem;
    margin-top: -.6rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* Filter tabs */
.ea-filter-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.ea-tab {
    border: 2px solid #dee2e6;
    background: #fff;
    border-radius: 2rem;
    padding: .35rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    color: #6c757d;
    transition: all .15s;
}
.ea-tab.active { border-color: var(--ea-accent); background: #eef2ff; color: var(--ea-accent); }

/* Emotion bars */
.ea-emotion-bars { display: flex; flex-direction: column; gap: .4rem; }
.ea-bar-row { display: flex; align-items: center; gap: .75rem; }
.ea-bar-label { width: 100px; font-size: .82rem; text-align: right; color: #555; }
.ea-bar-track { flex: 1; height: 10px; background: #e9ecef; border-radius: 5px; overflow: hidden; }
.ea-bar-fill  { height: 100%; background: var(--ea-accent); border-radius: 5px; transition: width .4s ease; }
.ea-bar-count { font-size: .8rem; color: #6c757d; width: 20px; }

/* =============================================
   RESPONSIVE — Mobile (? 575px)
   ============================================= */

@media (max-width: 575.98px) {

    /* Dashboard & form page fill the screen */
    .ea-dashboard,
    .ea-form-page {
        max-width: 100%;
        padding: 0 .75rem;
    }

    /* Welcome row stacks on small screens */
    .ea-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
        margin-bottom: 1rem;
    }

    .ea-welcome h2 {
        font-size: 1.2rem;
    }

    .ea-welcome h3 {
        font-size: 1.15rem;
        margin: 0;
    }

    .ea-welcome .btn {
        width: 100%;
    }

    /* Stats row: 3 equal cards on mobile */
    .ea-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: .6rem;
    }

    .ea-stat-card {
        padding: .75rem .5rem;
    }

    .ea-stat-number {
        font-size: 1.2rem;
    }

    .ea-stat-label {
        font-size: .65rem;
    }

    /* Entry cards: tighten layout */
    .ea-entry-card {
        gap: .6rem;
        padding: .75rem .85rem;
        align-items: flex-start;
    }

    .ea-entry-emoji {
        font-size: 1.6rem;
        padding-top: .1rem;
    }

    .ea-entry-note {
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    /* Emotion selection grid: 3 columns */
    .ea-emotion-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: .5rem;
    }

    .ea-emotion-btn {
        padding: .65rem .4rem;
    }

    .ea-emotion-icon {
        font-size: 1.5rem;
    }

    /* Intensity buttons: evenly spaced */
    .ea-intensity-row {
        gap: .35rem;
    }

    .ea-intensity-btn {
        padding: .5rem .35rem;
        font-size: .9rem;
    }

    /* Emotion bars */
    .ea-bar-label {
        width: 62px;
        font-size: .75rem;
    }

    /* Analysis result */
    .ea-result-emoji {
        font-size: 2.2rem;
    }

    .ea-analysis-inline {
        padding: .75rem .85rem;
    }

    /* Auth card full width */
    .auth-container {
        padding: .75rem;
    }

    .auth-card {
        padding: 2.25rem 1.25rem;
        border-radius: .875rem;
    }

    /* Filter tabs */
    .ea-filter-tabs {
        gap: .35rem;
    }

    .ea-tab {
        padding: .3rem .85rem;
        font-size: .8rem;
    }
}

/* =============================================
   SETTINGS PAGE
   ============================================= */

.ea-settings-section {
    background: var(--ea-card);
    border-radius: var(--ea-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.ea-settings-section-title {
    color: var(--ea-primary);
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid #e9ecef;
}

/* Profile picture */
.ea-profile-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ea-avatar-wrapper {
    flex-shrink: 0;
}

.ea-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
}

.ea-avatar-default {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #eef2ff;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ea-accent);
}

.ea-profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.ea-profile-hint {
    width: 100%;
    font-size: .78rem;
    color: #6c757d;
    margin: .1rem 0 0;
}

.ea-lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .75rem;
}

.ea-lang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding: .85rem .5rem;
    background: #f8f9ff;
    border: 2px solid #e9ecef;
    border-radius: var(--ea-radius);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
    font-size: .9rem;
    font-weight: 500;
    color: #444;
}

.ea-lang-btn:hover {
    border-color: var(--ea-accent);
    background: #eef2ff;
    transform: translateY(-2px);
}

.ea-lang-btn.active {
    border-color: var(--ea-accent);
    background: #eef2ff;
    color: var(--ea-primary);
    font-weight: 700;
}

.ea-lang-flag { font-size: 2.2rem; }
.ea-lang-name { font-size: .82rem; }

.ea-lang-notice {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: .6rem;
    padding: .75rem 1rem;
    font-size: .85rem;
    color: #1e40af;
    line-height: 1.45;
}
.ea-lang-notice-icon { flex-shrink: 0; font-size: 1rem; margin-top: .05rem; }

@media (max-width: 575.98px) {
    .ea-lang-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: .5rem;
    }

    .ea-lang-btn {
        padding: .65rem .35rem;
    }

    .ea-lang-flag { font-size: 1.6rem; }
    .ea-lang-name { font-size: .72rem; }
}

/* =============================================
   MIC / VOICE INPUT
   ============================================= */

.ea-note-wrapper {
    position: relative;
}

.ea-note-textarea {
    padding-right: 3rem;
    resize: vertical;
}

.ea-mic-btn {
    position: absolute;
    bottom: .55rem;
    right: .55rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: var(--ea-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    padding: 0;
    z-index: 1;
}
.ea-mic-btn:hover   { background: #0a2855; }
.ea-mic-btn.listening { background: #dc3545; }

.ea-mic-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.45);
    animation: ea-pulse 1.2s ease-out infinite;
}

@keyframes ea-pulse {
    0%   { transform: scale(1);   opacity: .85; }
    100% { transform: scale(2.3); opacity: 0;   }
}

.ea-interim-text {
    font-size: .82rem;
    color: #6c757d;
    font-style: italic;
    margin-top: .3rem;
    padding-left: .15rem;
}

/* =============================================
   TTS / READ ALOUD
   ============================================= */

.ea-tts-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .75rem;
}

.ea-tts-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .85rem;
    border-radius: 2rem;
    border: 2px solid var(--ea-primary);
    background: transparent;
    color: var(--ea-primary);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    line-height: 1;
}
.ea-tts-pill:hover              { background: var(--ea-primary); color: #fff; }
.ea-tts-pill.speaking           { border-color: #dc3545; background: #fff5f5; color: #dc3545; }
.ea-tts-pill.speaking:hover     { background: #dc3545; color: #fff; border-color: #dc3545; }

.ea-tts-wave {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}
.ea-tts-wave span {
    width: 3px;
    border-radius: 2px;
    background: currentColor;
    animation: ea-wave 0.75s ease-in-out infinite;
}
.ea-tts-wave span:nth-child(2) { animation-delay: .18s; }
.ea-tts-wave span:nth-child(3) { animation-delay: .36s; }

@keyframes ea-wave {
    0%, 100% { height: 4px;  }
    50%       { height: 14px; }
}
