:root {
    --accent: #0f766e;
    --accent-soft: #ccfbf1;
    --surface: #ffffff;
    --surface-alt: #f5f7f9;
    --text: #1f2937;
    --muted: #64748b;
    --border: #dbe2ea;
    --shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, #e4fffb 0%, #f8fafc 45%, #f1f5f9 100%);
    color: var(--text);
    font-family: "DM Sans", "Segoe UI", sans-serif;
    min-height: 100vh;
}

.app-header {
    padding: 1.2rem 1rem 0.6rem;
    display: flex;
    justify-content: space-between;
    gap: 0.9rem;
    align-items: flex-start;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
}

h1 {
    margin: 0.4rem 0 0;
    font-size: clamp(1.2rem, 2.8vw, 1.8rem);
    line-height: 1.25;
}

.account-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.account-user {
    font-size: 0.86rem;
    color: var(--muted);
    font-weight: 700;
}

.account-button {
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 10px;
    color: var(--text);
    padding: 0.42rem 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.account-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.workspace {
    padding: 0.8rem 1rem 5rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem;
    display: none;
}

.panel.is-active {
    display: block;
}

.panel + .panel {
    margin-top: 0.8rem;
}

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

h2 {
    margin: 0;
    font-size: 1.1rem;
}

h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.pill {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.progress-track {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    height: 10px;
    overflow: hidden;
    margin-bottom: 0.9rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
}

.monitor-list,
.suggestion-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.panel-profile .monitor-list + .card {
    margin-top: 0.9rem;
}

.monitor-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    background: var(--surface-alt);
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    font-size: 0.92rem;
}

.monitor-main {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.mini-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.mini-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
}

.status-complete .status-label {
    color: #15803d;
}

.status-in_progress .status-label {
    color: #b45309;
}

.status-pending .status-label {
    color: var(--muted);
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    background: var(--surface-alt);
}

.card p {
    margin: 0;
    color: #374151;
    line-height: 1.45;
}

.fit {
    margin-bottom: 0.45rem !important;
    color: var(--accent) !important;
    font-weight: 700;
}

.fit-subline {
    margin: 0.05rem 0 0.55rem !important;
    color: var(--muted) !important;
    font-size: 0.86rem;
}

.profile-full {
    margin-top: 0.9rem;
}

.profile-full summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.suggestion-card {
    display: grid;
    gap: 0.2rem;
}

.suggestion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.rank-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
}

.mini-list {
    margin: 0.1rem 0 0.15rem 1rem;
    padding: 0;
    color: #374151;
    font-size: 0.9rem;
}

.chat-shell {
    border: 1px solid var(--border);
    border-radius: 14px;
    min-height: 430px;
    overflow: hidden;
    background: #ffffff;
}

openai-chatkit {
    display: block;
    min-height: 430px;
    width: 100%;
}

.hint {
    margin: 0.65rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.mobile-tabs {
    position: fixed;
    bottom: 0.65rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    padding: 0.35rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(96%, 420px);
    gap: 0.3rem;
    z-index: 20;
}

.mobile-tab {
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.6rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #e2e8f0;
    background: transparent;
    cursor: pointer;
}

.mobile-tab.is-active {
    background: var(--accent);
    color: #f8fafc;
}

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

.auth-card {
    width: min(100%, 430px);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.auth-title {
    margin: 0 0 0.8rem;
    font-size: 1.3rem;
}

.auth-copy {
    margin: 0 0 1rem;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 0.75rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.58rem 0.65rem;
    font-size: 0.95rem;
}

.auth-form input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

.auth-submit {
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    padding: 0.62rem 0.8rem;
    cursor: pointer;
}

.auth-link {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0.75rem 0 0;
}

.auth-link a {
    color: var(--accent);
}

.auth-errors {
    margin: 0;
    padding: 0.55rem 0.7rem;
    list-style: none;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 10px;
    font-size: 0.88rem;
}

@media (min-width: 1024px) {
    .mobile-tabs {
        display: none;
    }

    .workspace {
        display: grid;
        grid-template-columns: 1fr 1.2fr 1fr;
        gap: 0.8rem;
        padding: 0.8rem 1rem 1rem;
        min-height: calc(100vh - 110px);
        align-items: start;
    }

    .panel {
        display: block;
        margin-top: 0;
        overflow: auto;
    }

    .panel + .panel {
        margin-top: 0;
    }

    .panel-profile {
        order: 1;
    }

    .panel-chat {
        order: 2;
    }

    .panel-suggestions {
        order: 3;
    }
}
