:root {
    --bg-color: #f5f7fb;
    --card-bg: #ffffff;
    --navy: #102847;
    --teal: #0ea5a0;
    --gold: #e2b83e;
    --gold-glow: rgba(226, 184, 62, 0.35);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --radius: 16px;
    --danger: #e53935;
    --line: #dbe4f0;
}

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

body {
    background:
        radial-gradient(circle at 0 0, rgba(14, 165, 160, 0.22), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(16, 40, 71, 0.15), transparent 35%),
        var(--bg-color);
    color: var(--text-primary);
    font-family: 'SUIT', 'Pretendard', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: 2rem 1.2rem 3rem;
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 2.2rem;
    text-align: left;
    box-shadow: 0 18px 50px rgba(16, 40, 71, 0.13);
}

.auth-hero,
.app-hero {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-hero {
    margin-bottom: -0.35rem;
}

.auth-badge {
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--teal);
    background: rgba(14, 165, 160, 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    margin: 0;
}

.auth-card h1 {
    color: var(--navy);
    margin-top: 0;
    margin-bottom: 0;
    font-size: 2rem;
}

.brand-meta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
}

.brand-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    text-align: center;
    margin-top: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #fff7db;
    border: 1px solid #f2d681;
    font-size: 1.15rem;
}

.brand-illustration {
    object-fit: contain;
    border: none;
    box-shadow: none;
    background: transparent;
    mix-blend-mode: normal;
}

.brand-illustration.giant-login {
    width: 420px;
    height: 420px;
}

.brand-illustration.giant-app {
    width: 400px;
    height: 400px;
}

.auth-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.auth-actions {
    display: grid;
    gap: 0.7rem;
}

.auth-btn {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
}

.google-btn {
    background: #ffffff;
    border-color: var(--line);
    color: #111827;
}

.google-btn i {
    color: #ea4335;
    margin-right: 0.35rem;
}

.kakao-btn {
    background: #fee500;
    color: #191600;
}

.kakao-btn i {
    margin-right: 0.35rem;
}

.guest-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.auth-status {
    margin-top: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
}

.app-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    text-align: center;
    margin-top: 0;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 2.2rem;
}

header h1 {
    font-size: 2.8rem;
    color: var(--navy);
    text-shadow: 0 0 20px var(--gold-glow);
    margin-bottom: 0.5rem;
}

.user-bar {
    margin-top: 1rem;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.header-tools {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
}

.manual-highlight-btn {
    background: #0ea5a0;
    color: #ffffff;
    border: 2px solid #0b7f7b;
    border-radius: 12px;
    padding: 0.5rem 0.85rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(14, 165, 160, 0.26);
}

.manual-highlight-btn:hover {
    filter: brightness(0.95);
}

.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
    margin-bottom: 2.6rem;
}

.voice-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    text-align: center;
}

#voice-status {
    min-height: 1.2em;
}

.glow-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid var(--gold);
    color: var(--gold);
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--gold-glow);
}

.glow-btn:hover {
    background: var(--gold);
    color: #000;
}

.glow-btn.recording {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(229, 57, 53, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

.text-input-container {
    display: flex;
    width: 100%;
    max-width: 550px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.entry-date-bar {
    width: 100%;
    max-width: 550px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.entry-date-bar .helper-text {
    margin: 0;
}

#exercise-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #111827;
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    outline: none;
}

#add-btn {
    background: var(--gold);
    color: #111827;
    border: none;
    padding: 0 2rem;
    border-radius: calc(var(--radius) - 4px);
    font-weight: 700;
    cursor: pointer;
}

.workout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
}

.export-section {
    margin-top: 1.4rem;
    margin-bottom: 2rem;
}

.export-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem;
    margin-top: 0.9rem;
}

.export-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.export-head h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--navy);
}

.export-output {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.75rem;
    font: 500 0.9rem/1.45 "Pretendard", "Noto Sans KR", sans-serif;
    color: #1f2937;
    background: #f8fafc;
}

.export-output.detail {
    min-height: 170px;
}

.calendar-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#selected-date {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
    color: #1f2937;
    background: #fff;
    font: 600 0.9rem/1.2 "Pretendard", "Noto Sans KR", sans-serif;
}

.workout-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    transition: 0.3s;
    box-shadow: 0 10px 22px rgba(16, 40, 71, 0.08);
}

.master-panel {
    margin-top: 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: 0 10px 22px rgba(16, 40, 71, 0.08);
}

.master-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 1.2rem;
}

.master-stat-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem;
}

.master-stat-card span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.master-stat-card strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.3rem;
    color: var(--navy);
}

.master-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.master-list-panel,
.master-detail-panel {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem;
}

.master-user-list,
.master-detail-list {
    margin-top: 0.6rem;
    display: grid;
    gap: 0.5rem;
}

.master-user-item {
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.7rem;
    cursor: pointer;
}

.master-user-item:hover {
    border-color: var(--teal);
}

.master-user-main {
    font-weight: 700;
    color: #0f172a;
}

.master-user-sub {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.master-empty {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.workout-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.card-info {
    padding: 1rem;
}

.card-info h3 {
    font-size: 1.1rem;
    color: var(--navy);
    margin-bottom: 0.6rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.93rem;
    gap: 0.6rem;
}

.card-note-preview {
    margin-top: 0.55rem;
    min-height: 52px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
}

.card-note-preview.is-empty {
    color: #94a3b8;
}

.card-actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.outline-btn.small {
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    font-size: 0.82rem;
}

.outline-btn.danger {
    color: var(--danger);
    border-color: rgba(229, 57, 53, 0.5);
}

/* Modal UI */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #ffffff;
    margin: 10% auto;
    padding: 2.5rem;
    border: 1px solid var(--line);
    width: 90%;
    max-width: 680px;
    border-radius: var(--radius);
    position: relative;
}

.manual-content {
    max-width: 760px;
    max-height: 80vh;
    overflow-y: auto;
}

.manual-block {
    margin-top: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.manual-block h4 {
    margin: 0 0 0.5rem;
    color: var(--navy);
}

.manual-block ul {
    margin: 0;
    padding-left: 1.1rem;
}

.report-summary {
    display: flex;
    justify-content: space-around;
    gap: 0.8rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    padding: 1rem;
    border-radius: 12px;
}

.report-top-line {
    margin: 1rem 0;
    color: var(--navy);
    font-weight: 700;
}

.report-chart {
    margin-top: 1rem;
    display: grid;
    gap: 0.7rem;
}

.chart-row {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    align-items: center;
    gap: 0.6rem;
}

.chart-label {
    font-size: 0.9rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-track {
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

.chart-value {
    text-align: right;
    font-weight: 700;
    color: #1e293b;
}

.confirm-box {
    text-align: center;
    border: 2px solid var(--gold);
}

.confirm-box h3 {
    margin-bottom: 1.5rem;
    color: var(--navy);
}

.confirm-preview {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}

.action-btn.yes {
    background: var(--gold);
    color: #111827;
}

.action-btn.no {
    background: #cbd5e1;
    color: #0f172a;
}

.outline-btn {
    background: transparent;
    border: 1.5px solid var(--navy);
    color: var(--navy);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.email-section {
    margin-top: 2.5rem;
    display: flex;
    gap: 10px;
}

#email-input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: #0f172a;
    padding: 1rem;
    border-radius: 12px;
}

.helper-text {
    color: var(--text-secondary);
    margin: 0.6rem 0 1rem;
}

.profile-form {
    display: grid;
    gap: 10px;
    margin-bottom: 1rem;
}

.profile-form input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: #0f172a;
    padding: 0.9rem 1rem;
    border-radius: 10px;
}

.site-footer {
    margin: 0 auto 1.2rem;
    width: min(100%, 920px);
    padding: 0 1.2rem;
    color: #64748b;
    font-size: 0.88rem;
    text-align: center;
}

.footer-links {
    margin-top: 0.3rem;
    display: flex;
    justify-content: center;
    gap: 0.9rem;
}

.footer-links a {
    color: #475569;
    text-decoration: none;
    border-bottom: 1px dashed #94a3b8;
}

@media (max-width: 600px) {
    #app {
        padding: 1rem 0.8rem 2rem;
    }

    .workout-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .auth-card {
        padding: 1.4rem;
    }

    .auth-card h1 {
        font-size: 1.7rem;
    }

    .brand-illustration.giant-login {
        width: 290px;
        height: 290px;
    }

    .brand-illustration.giant-app {
        width: 270px;
        height: 270px;
    }

    .brand-meta {
        gap: 0.45rem;
        margin-bottom: 1rem;
    }

    .text-input-container {
        flex-direction: column;
        gap: 6px;
        background: transparent;
        border: none;
        padding: 0;
    }

    #exercise-input {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
    }

    #add-btn {
        width: 100%;
        padding: 0.7rem 1rem;
    }

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

    .header-tools {
        position: static;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .chart-row {
        grid-template-columns: 90px 1fr 44px;
    }
}

.edit-note-input {
    width: 100%;
    min-height: 120px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: #0f172a;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    resize: vertical;
    font: inherit;
}

.brand-suffix {
    font-size: 0.45em;
    vertical-align: super;
    letter-spacing: 0.04em;
}

.feedback-section,
.ai-models-section {
    margin-top: 2.2rem;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: 0 10px 22px rgba(16, 40, 71, 0.08);
}

.feedback-head,
.ai-models-head {
    align-items: center;
}

.feedback-ai-visual,
.ai-models-hero {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.feedback-shell {
    display: grid;
    gap: 1rem;
}

.feedback-form-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
}

.feedback-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.feedback-form-grid input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--line);
    color: #0f172a;
    padding: 0.9rem 1rem;
    border-radius: 10px;
}

.feedback-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
}

.feedback-list {
    display: grid;
    gap: 0.85rem;
}

.feedback-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
}

.feedback-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.feedback-author {
    font-weight: 800;
    color: var(--navy);
}

.feedback-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.feedback-content {
    color: #1e293b;
    line-height: 1.6;
    white-space: pre-wrap;
}

.feedback-card-actions {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ai-model-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.ai-model-card {
    display: grid;
    gap: 0.45rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
}

.ai-model-card strong {
    color: var(--navy);
}

.ai-model-card span {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

@media (max-width: 600px) {
    .feedback-form-grid,
    .ai-model-grid {
        grid-template-columns: 1fr;
    }

    .feedback-form-actions,
    .feedback-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .feedback-ai-visual,
    .ai-models-hero {
        width: 88px;
        height: 88px;
    }
}

.feedback-action-password {
    min-width: 150px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: #0f172a;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
}
