@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Merriweather', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f6f4ef;
    color: #171717;
}
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.container.wide { align-items: flex-start; }
.card {
    width: 100%;
    max-width: 760px;
    background: #ffffff;
    border: 1px solid #e7e2d8;
    border-radius: 10px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.06);
}
.wide .card { max-width: 1100px; }
.brand {
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 26px;
    margin-bottom: 20px;
}
.privacy-box {
    background: #f0f7f1;
    border: 1px solid #cfe8d3;
    color: #214428;
    padding: 14px 16px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}
.progress-wrap {
    width: 100%;
    height: 8px;
    background: #eee9df;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}
.progress-bar {
    height: 100%;
    background: #111111;
    transition: width 0.3s ease;
}
.step { color: #777; font-size: 14px; margin: 0; }
.section {
    display: inline-block;
    margin: 12px 0;
    padding: 6px 12px;
    background: #f3f0e8;
    border-radius: 5px;
    font-size: 13px;
    color: #555;
}
h1 {
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.05;
    letter-spacing: -0.06em;
    margin: 12px 0 26px;
}
h2 {
    margin-top: 34px;
    font-size: 24px;
    letter-spacing: -0.03em;
}
textarea, input[type="text"] {
    width: 100%;
    border: 1px solid #ddd6ca;
    background: #fbfaf7;
    border-radius: 5px;
    padding: 18px;
    font-size: 17px;
    outline: none;
    resize: vertical;
}
textarea { min-height: 180px; }
textarea:focus, input:focus { border-color: #111; background: #fff; }
.actions {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.btn {
    appearance: none;
    border: none;
    text-decoration: none;
    background: #111;
    color: white;
    padding: 10px 22px;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: #eee9df; color: #111; }
.muted { color: #666; margin-bottom: 28px; }
.small { font-size: 14px; }
.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.result-grid.one { grid-template-columns: 1fr; margin-bottom: 18px; }
.result-card {
    background: #fbfaf7;
    border: 1px solid #e7e2d8;
    border-radius: 10px;
    padding: 20px;
}
.result-card h3 {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.4;
}
.result-card p {
    margin: 0 0 8px;
    color: #444;
    line-height: 1.6;
}
.reading-box {
    background: #fbfaf7;
    border: 1px solid #e7e2d8;
    border-radius: 10px;
    padding: 20px;
    line-height: 1.7;
    margin-bottom: 22px;
    color: #333;
}
.recorder {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.audio-preview, audio { width: 100%; margin-top: 10px; }
@media (max-width: 700px) {
    .card { padding: 24px; border-radius: 10px; }
    .result-grid { grid-template-columns: 1fr; }
    .actions { flex-direction: column; }
    .btn { text-align: center; width: 100%; }
}

.field-label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    color: #555;
    font-weight: 700;
}

.error-box {
    background: #fff1f1;
    border: 1px solid #f0c2c2;
    color: #7a1d1d;
    padding: 14px 16px;
    border-radius: 4px;
    margin-bottom: 18px;
}

.admin-card {
    max-width: 520px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.admin-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn.small {
    padding: 9px 14px;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.stat-card {
    background: #fbfaf7;
    border: 1px solid #e7e2d8;
    border-radius: 10px;
    padding: 18px;
}

.stat-card strong {
    display: block;
    font-size: 32px;
    letter-spacing: -0.05em;
}

.stat-card span {
    color: #666;
    font-size: 14px;
}

.search-form {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid #e7e2d8;
    vertical-align: middle;
}

.admin-table th {
    font-size: 13px;
    color: #666;
    background: #fbfaf7;
}

.admin-table td span {
    color: #777;
    font-size: 13px;
}

.profile-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.profile-summary div {
    background: #fbfaf7;
    border: 1px solid #e7e2d8;
    border-radius: 10px;
    padding: 18px;
}

.profile-summary strong {
    display: block;
    margin-bottom: 8px;
}

.profile-summary span {
    display: block;
    color: #555;
    line-height: 1.5;
}

.export-box {
    min-height: 360px;
    font-family: 'Merriweather', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 28px;
}

audio {
    width: 100%;
    margin-top: 12px;
}

@media (max-width: 700px) {
    .admin-topbar,
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid,
    .profile-summary {
        grid-template-columns: 1fr;
    }
}

/* Motion layer */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes softPop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes progressGlow {
    0% { box-shadow: 0 0 0 rgba(17,17,17,0); }
    50% { box-shadow: 0 0 22px rgba(17,17,17,0.18); }
    100% { box-shadow: 0 0 0 rgba(17,17,17,0); }
}

@keyframes pulseRing {
    0% { transform: scale(0.92); opacity: 0.65; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes orbBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.entrance-card {
    animation: cardIn 0.55s cubic-bezier(.2,.8,.2,1) both;
}

.soft-pop,
.float-in,
.answer-form,
.confirm-transcript.reveal,
.result-card,
.stat-card {
    animation: softPop 0.45s ease both;
}

.progress-bar {
    animation: progressGlow 1.2s ease;
}

.btn,
.result-card,
.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.result-card:hover,
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(0,0,0,0.055);
}

.recorder-panel {
    display: grid;
    place-items: center;
    gap: 16px;
    background: #fbfaf7;
    border: 1px solid #e7e2d8;
    border-radius: 10px;
    padding: 24px;
    margin: 22px 0;
}

.recorder-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.recorder-orb {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #111;
    position: relative;
    display: grid;
    place-items: center;
    animation: orbBreath 2.6s ease-in-out infinite;
}

.recorder-orb span {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #fff;
    opacity: 0.92;
}

.recorder-orb.recording::before,
.recorder-orb.recording::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 2px solid rgba(17,17,17,0.35);
    animation: pulseRing 1.4s ease-out infinite;
}

.recorder-orb.recording::after {
    animation-delay: 0.35s;
}

.confirm-transcript {
    margin-top: 20px;
}

.transcript-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

.audio-preview {
    width: 100%;
    margin: 12px 0;
}

.transcript-view {
    margin-top: 14px;
    padding: 14px;
    border-radius: 10px;
    background: #f6f4ef;
}

.warning-text {
    color: #8a4b00;
}

.answer-source {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: #666;
    background: #eee9df;
    border-radius: 999px;
    padding: 5px 9px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Updated input polish */
textarea,
input[type="text"] {
    font-family: 'Merriweather', Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0 18px;
}

.choice-btn {
    border: 1px solid #ddd6ca;
    background: #fbfaf7;
    color: #171717;
    border-radius: 8px;
    padding: 20px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.06);
    border-color: #111;
}

.choice-btn.selected {
    background: #111;
    color: #fff;
    border-color: #111;
    box-shadow: 0 18px 44px rgba(0,0,0,0.12);
}

.success-card {
    text-align: center;
    max-width: 680px;
}

.check-wrap {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: #e8f8ed;
    border: 1px solid #bfe8c9;
    color: #1d7f3a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    font-weight: 900;
    margin: 12px auto 22px;
    animation: checkPop 0.55s cubic-bezier(.2,.9,.2,1.2) both;
}

.success-note {
    background: #f0f7f1;
    border: 1px solid #cfe8d3;
    color: #214428;
    padding: 16px 18px;
    border-radius: 8px;
    line-height: 1.6;
    margin-top: 20px;
}

@keyframes checkPop {
    0% { transform: scale(0.72); opacity: 0; }
    65% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
