/* ═══════════════════════════════════════════════════════
   Agent / Chat / Home — Paper & Terracotta edition
   ═══════════════════════════════════════════════════════ */

/* ── View switching ── */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
    flex: 1;
}

.active-view {
    display: block;
}

#chatView.active-view {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    contain: layout paint style;
    animation: fadeInOpacity 0.4s ease;
}

/* ═══════════════════════════════════════════════════════
   HERO — Home landing
   ═══════════════════════════════════════════════════════ */

.hero {
    text-align: center;
    margin: 1.5rem auto 2rem;
    padding: 3rem 2rem 2.5rem;
    max-width: 1120px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-glow);
    opacity: 0.5;
    pointer-events: none;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--accent-light);
    background: var(--accent-glow);
    color: var(--accent-dark);
    border-radius: var(--radius-full);
    padding: 0.35rem 1rem;
    margin-bottom: 1.8rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: 0.04em;
}

.hero p {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 1.05rem;
    line-height: 1.85;
}

.hero-lead {
    max-width: 860px;
    margin: 1.2rem auto 0;
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: 1.05rem;
}

.hero-highlights {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.hero-chip:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.cta-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    font-family: var(--font-body);
    padding: 0.9rem 2.4rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(193, 102, 75, 0.22);
    letter-spacing: 0.03em;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(193, 102, 75, 0.32);
    background: var(--accent-dark);
}

/* ═══════════════════════════════════════════════════════
   FEATURE CARDS
   ═══════════════════════════════════════════════════════ */

.card-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0 1rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.4rem;
    width: 260px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.feature-card i {
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    display: block;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.feature-card p {
    color: var(--text-secondary);
    margin-top: 0.4rem;
    line-height: 1.7;
    font-size: 0.93rem;
}

/* ═══════════════════════════════════════════════════════
   HOME SECTIONS — testimonials etc.
   ═══════════════════════════════════════════════════════ */

.home-section {
    margin-top: 2.5rem;
}

.section-intro {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 1.2rem;
}

.section-intro h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.section-intro p {
    margin-top: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.voice-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.voice-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.voice-card i {
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.7;
}

.voice-card h3 {
    margin-top: 0.8rem;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-primary);
}

.voice-card p {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.93rem;
}

/* ═══════════════════════════════════════════════════════
   CHAT CONTAINER
   ═══════════════════════════════════════════════════════ */

.chat-container {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chat-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* ── Sidebar ── */

.sidebar-scrim,
.sidebar-close-btn,
.mobile-history-btn {
    display: none;
}

.conversation-sidebar {
    border-right: 1px solid var(--border);
    background: var(--surface-muted);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem 0.65rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-primary);
}

.conversation-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversation-item {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.9rem;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font: inherit;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.conversation-item:hover {
    background: var(--surface-elevated);
    border-color: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.conversation-item.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: inset 0 0 0 1px rgba(193, 102, 75, 0.18);
}

.conversation-item-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.35;
    font-size: 0.93rem;
}

.conversation-item-preview,
.conversation-item-time {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.conversation-item-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    min-height: 2.6em;
}

.conversation-item-time {
    margin-top: 0.45rem;
    opacity: 0.8;
}

/* ── Chat Main ── */

.chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--surface-muted);
    overflow: hidden;
}

.chat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--nav-gap);
    padding: 0.45rem 0.85rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.chat-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.quota-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent-light);
    background: var(--accent-glow);
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Check-in Banner ── */
.checkin-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    margin: 0 0 0.15rem;
    background: linear-gradient(135deg, var(--accent-glow), var(--surface));
    border: 1px solid var(--accent-light);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-secondary);
    animation: fadeIn 0.35s ease;
}

.checkin-banner-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.checkin-banner-text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.checkin-banner-text strong {
    color: var(--accent-dark);
    font-weight: 600;
}

.checkin-banner-btn {
    flex-shrink: 0;
    padding: 0.35rem 0.85rem;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(193, 102, 75, 0.25);
}

.checkin-banner-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 14px rgba(155, 74, 53, 0.32);
}

.checkin-banner-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.checkin-banner-close:hover {
    color: var(--accent);
}

/* ── Check-in Button ── */
.checkin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 36px;
    width: auto;
    height: 36px;
    min-height: 36px;
    padding: 0 0.65rem;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    white-space: nowrap;
}

.checkin-btn:not(.checked) {
    animation: checkinPulse 2.8s ease-in-out infinite;
}

.checkin-label {
    font-size: 0.82rem;
}

.checkin-btn:hover {
    border-color: var(--accent-dark);
    background: var(--accent-light);
    box-shadow: 0 0 0 6px var(--accent-glow);
}

.checkin-btn.checked {
    border-color: var(--accent-light);
    background: var(--accent-light);
    color: var(--accent-dark);
    box-shadow: inset 0 1px 3px rgba(193, 102, 75, 0.12);
    animation: none;
    min-width: 36px;
    padding: 0;
}

.checkin-btn.checked .checkin-label {
    display: none;
}

.checkin-btn.bouncing .checkin-icon {
    animation: checkinBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkin-icon {
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes checkinPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow), 0 0 0 0 rgba(193, 102, 75, 0.15); }
    50%      { box-shadow: 0 0 0 6px transparent, 0 0 0 10px transparent; }
}

@keyframes checkinBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.4); }
    60%  { transform: scale(0.85); }
    100% { transform: scale(1); }
}

/* ── Floating +1 Animation ── */
.float-plus-one {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius-full);
    padding: 0.25rem 0.65rem;
    animation: floatUp 1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(193, 102, 75, 0.3);
}

@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0) scale(0.8); }
    30%  { opacity: 1; transform: translateY(-22px) scale(1.2); }
    70%  { opacity: 0.7; transform: translateY(-38px) scale(1); }
    100% { opacity: 0; transform: translateY(-52px) scale(0.7); }
}

/* ── Check-in Panel ── */
.checkin-panel {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.checkin-panel.is-open {
    display: flex;
}

.checkin-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 10, 8, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.checkin-panel-card {
    position: relative;
    z-index: 1;
    width: min(360px, calc(100vw - 2rem));
    padding: 1.6rem 1.4rem 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: fadeInScale 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkin-panel-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.checkin-panel-close:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

.checkin-panel-header {
    margin-bottom: 1.1rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-primary);
}

.checkin-panel-fire {
    font-size: 1.3rem;
}

.checkin-panel-header strong {
    color: var(--accent-dark);
    font-weight: 700;
}

/* 7-day row */
.checkin-panel-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.checkin-day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.checkin-day-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1;
}

.checkin-day-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.25s ease;
    position: relative;
}

.checkin-day-cell.checked .checkin-day-circle {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.8rem;
}

.checkin-day-cell.today .checkin-day-circle {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 4px var(--accent-glow);
    border-width: 2.5px;
    color: var(--accent-dark);
    font-weight: 700;
}

.checkin-day-cell.today.checked .checkin-day-circle {
    background: var(--accent);
    color: #fff;
}

.checkin-day-reward {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1;
}

.checkin-day-cell.checked .checkin-day-reward {
    color: var(--accent-dark);
    font-weight: 500;
}

.checkin-day-cell.today .checkin-day-reward {
    color: var(--accent-dark);
    font-weight: 600;
}

.checkin-panel-today-reward {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-md);
    background: var(--accent-glow);
    display: inline-block;
}

.checkin-panel-today-reward strong {
    color: var(--accent-dark);
}

.checkin-panel-btn {
    width: 100%;
    max-width: 200px;
}

.checkin-panel-done {
    display: inline-block;
    padding: 0.55rem 0;
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    max-width: 200px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    border: 1px solid var(--accent);
}

.chat-current {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 500;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.icon-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.icon-text-btn:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--surface-elevated);
}

/* ── Messages ── */

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-anchor: none;
    padding: 1.4rem 1.4rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    min-width: 0;
    animation: fadeIn 0.25s ease;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
}

.message.user .avatar {
    background: var(--text-secondary);
    color: var(--surface);
}

.bubble {
    background: var(--surface-elevated);
    flex: 1 1 auto;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    line-height: 1.7;
    word-break: break-word;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

.message.user .bubble {
    background: var(--accent-glow);
    border-color: var(--accent-light);
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 20px;
}

/* ── Bubble content ── */

.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4 {
    font-family: var(--font-display);
    line-height: 1.35;
    margin: 0.35rem 0 0.5rem;
}

.bubble h1 { font-size: 1.4rem; }
.bubble h2 { font-size: 1.2rem; }
.bubble h3 { font-size: 1.08rem; }
.bubble h4 { font-size: 1rem; }

.bubble p,
.bubble ul,
.bubble ol,
.bubble blockquote,
.bubble pre,
.bubble hr,
.bubble .table-wrap {
    margin: 0.45rem 0;
}

.bubble ul,
.bubble ol {
    padding-left: 1.3rem;
}

.bubble hr {
    border: 0;
    border-top: 1px solid var(--border);
}

.bubble code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(193, 102, 75, 0.10);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.bubble pre {
    overflow-x: auto;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.bubble pre code {
    background: transparent;
    padding: 0;
}

.bubble blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 0.8rem;
    color: var(--text-secondary);
}

.bubble a {
    color: var(--accent-dark);
}

.bubble strong {
    font-weight: 700;
}

.bubble del {
    opacity: 0.7;
}

.bubble .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.bubble table {
    width: 100%;
    border-collapse: collapse;
    min-width: 360px;
    font-size: 0.93rem;
}

.bubble th,
.bubble td {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.bubble th {
    background: var(--accent-glow);
    font-weight: 700;
}

/* ── Welcome ── */

.welcome-copy {
    line-height: 1.75;
}

.welcome-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.95rem;
}

.welcome-prompt-btn {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
    text-align: left;
    font: inherit;
    font-size: 0.93rem;
    line-height: 1.55;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.welcome-prompt-btn:hover,
.welcome-prompt-btn:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-md);
}

/* ── Chat Input ── */

.chat-input-area {
    padding: 0.7rem 0.9rem 0.8rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-input-row {
    display: flex;
    gap: 10px;
}

.chat-input-row input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-input-row input::placeholder {
    color: var(--text-muted);
}

.chat-input-row button {
    -webkit-appearance: none;
    appearance: none;
    background: var(--accent);
    border: none;
    color: #fff;
    width: 46px;
    flex: 0 0 46px;
    border-radius: var(--radius-md);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.chat-input-row button:hover {
    background: var(--accent-dark);
    transform: scale(1.04);
}

.chat-input-row button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.chat-input-row button i {
    pointer-events: none;
}

.chat-disclaimer-short {
    display: none;
}

.chat-disclaimer-text {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.45;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════
   PROFILE PANEL
   ═══════════════════════════════════════════════════════ */

.profile-panel {
    max-width: 680px;
    margin: 2rem auto;
    padding: 1.6rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    gap: var(--nav-gap);
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 1.6rem;
}

.profile-main h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-main p {
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.profile-actions {
    margin-top: 2rem;
}

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

.profile-stat-card {
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.profile-stat-label,
.membership-section-head p,
.order-item-meta,
.order-item-status,
.profile-note,
.empty-state {
    color: var(--text-secondary);
}

.profile-stat-value {
    margin-top: 0.45rem;
    font-size: 1.8rem;
    font-family: var(--font-display);
    font-weight: 600;
}

/* ── Membership ── */

.membership-section {
    margin-top: 1.7rem;
}

.membership-section-head h3 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 600;
}

.membership-section-head p {
    margin-top: 0.35rem;
    line-height: 1.6;
}

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

.membership-plan-card {
    padding: 1.05rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.membership-plan-card:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-md);
}

.membership-plan-name {
    font-weight: 700;
    color: var(--text-primary);
}

.membership-plan-price {
    margin-top: 0.55rem;
    font-size: 1.7rem;
    font-family: var(--font-display);
    font-weight: 600;
}

.membership-plan-quota {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.93rem;
}

.membership-buy-btn {
    width: 100%;
    margin-top: 1rem;
}

/* ── Invite ── */

.invite-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1.05rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.invite-card-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.invite-card-title {
    font-weight: 700;
}

.invite-card-desc,
.invite-card-meta {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.93rem;
}

.invite-open-btn {
    flex: 0 0 180px;
    width: 180px;
    min-width: 180px;
    align-self: center;
}

/* ── Orders ── */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1rem;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.order-item-title {
    font-weight: 600;
}

.order-item-meta,
.order-item-status {
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.order-item-side {
    text-align: right;
}

.order-item-action {
    margin-top: 0.45rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-size: 0.88rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.order-item-action:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.empty-state {
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    line-height: 1.6;
}

.profile-note {
    margin-top: 0.9rem;
    line-height: 1.6;
    font-size: 0.93rem;
}

/* ═══════════════════════════════════════════════════════
   MODALS — Quota / Payment / Invite
   ═══════════════════════════════════════════════════════ */

.quota-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    overflow: hidden;
}

.quota-modal.is-open {
    display: flex;
}

.quota-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(12, 10, 8, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.quota-modal-card {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(88dvh, 820px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-xl);
}

.quota-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quota-modal-close:hover {
    background: var(--surface-muted);
    color: var(--accent);
}

.quota-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.8rem;
    border-radius: var(--radius-full);
    background: var(--accent-glow);
    border: 1px solid var(--accent-light);
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 500;
}

.quota-modal-card h3 {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
}

.quota-modal-copy,
.quota-modal-note {
    margin-top: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.94rem;
}

.quota-modal-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.05rem;
}

.quota-modal-stat {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.quota-modal-stat span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.quota-modal-stat strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
}

.quota-modal-plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.quota-modal-plan {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.quota-modal-plan:hover {
    border-color: var(--accent-light);
}

.quota-modal-plan-name {
    font-weight: 700;
}

.quota-modal-plan-price {
    margin-top: 0.5rem;
    font-size: 1.4rem;
    font-family: var(--font-display);
    font-weight: 600;
}

.quota-modal-plan-quota {
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.93rem;
}

.quota-modal-plan .auth-btn {
    width: 100%;
    margin-top: 0.9rem;
}

.quota-modal-secondary {
    margin-top: 1rem;
}

/* ── Invite Modal ── */

.invite-modal-card {
    width: min(620px, 100%);
}

.invite-link-box {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    line-height: 1.7;
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    user-select: all;
    -webkit-user-select: all;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.invite-link-box:active {
    background: var(--accent-glow);
    border-color: var(--accent-light);
}

.invite-modal-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

/* ── Payment Modal ── */

.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    overflow: hidden;
}

.payment-modal.is-open {
    display: flex;
}

.payment-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(12, 10, 8, 0.50);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.payment-modal-card {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(90dvh, 860px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-xl);
}

.payment-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.payment-modal-close:hover {
    color: var(--accent);
}

.payment-modal-card h3 {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
}

.payment-modal-copy,
.payment-modal-note {
    margin-top: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.94rem;
}

.payment-modal-section {
    margin-top: 1.05rem;
}

.payment-modal-section-title {
    margin-bottom: 0.65rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.payment-platform-card,
.payment-product-card,
.payment-info-item {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.payment-platform-card {
    padding: 1rem 1.05rem;
    font-weight: 700;
    font-size: 1.02rem;
}

.payment-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.payment-info-item {
    padding: 0.9rem 1rem;
}

.payment-info-item span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.payment-info-item strong {
    display: block;
    margin-top: 0.35rem;
    line-height: 1.5;
    font-weight: 700;
}

#paymentOrderNo {
    font-size: 0.88rem;
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.payment-product-card {
    padding: 1rem 1.05rem;
}

.payment-product-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.payment-product-desc {
    margin-top: 0.4rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.93rem;
}

.payment-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}

.payment-product-meta span {
    color: var(--text-secondary);
    font-size: 0.93rem;
}

.payment-product-meta strong {
    font-size: 1.3rem;
    font-family: var(--font-display);
    font-weight: 600;
}

.payment-submit-btn {
    width: 100%;
    margin-top: 1rem;
}

.payment-secondary-btn {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Tablet / Mobile
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .hero {
        margin: 0.6rem 0;
        padding: 1.4rem 1rem 1.2rem;
        border-radius: var(--radius-lg);
    }

    .hero h1 {
        font-size: clamp(1.7rem, 7vw, 2.2rem);
    }

    .hero p {
        font-size: 0.94rem;
        margin-top: 0.6rem;
    }

    .hero-lead {
        margin-top: 0.7rem;
        font-size: 0.94rem;
    }

    .tech-badge {
        font-size: 0.84rem;
        margin-bottom: 0.8rem;
    }

    .hero-highlights {
        gap: 0.45rem;
    }

    .cta-btn {
        width: 100%;
        min-height: 48px;
        padding: 0.85rem 1.2rem;
        font-size: 1rem;
    }

    .card-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 0.8rem 0 0;
    }

    .feature-card {
        width: 100%;
        padding: 1.15rem;
    }

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

    .section-intro h2 {
        font-size: 1.35rem;
    }

    .hero-chip {
        width: 100%;
        justify-content: center;
    }

    /* Chat */
    .chat-shell {
        grid-template-columns: 1fr;
    }

    .conversation-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(280px, 78vw);
        max-height: none;
        border-right: 1px solid var(--border);
        border-bottom: 0;
        box-shadow: none;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
    }

    #chatView.conversation-sidebar-open .conversation-sidebar {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: absolute;
        inset: 0;
        z-index: 35;
        border: 0;
        background: rgba(12, 10, 8, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    #chatView.conversation-sidebar-open .sidebar-scrim {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-close-btn,
    .mobile-history-btn {
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text-primary);
        cursor: pointer;
    }

    .sidebar-close-btn {
        display: inline-flex;
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border-radius: 50%;
    }

    .mobile-history-btn {
        display: inline-flex;
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 50%;
    }

    .chat-container {
        min-height: 0;
        border-radius: var(--radius-lg);
    }

    .message {
        max-width: 95%;
    }

    .message .avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .bubble {
        padding: 0.7rem 0.9rem;
        border-radius: 16px;
        border-bottom-left-radius: 6px;
        font-size: 0.93rem;
        line-height: 1.65;
    }

    .message.user .bubble {
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 6px;
    }

    .chat-toolbar,
    .profile-header {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .chat-toolbar {
        flex-wrap: nowrap;
        padding: 0.35rem 0.6rem;
    }

    .chat-current {
        flex: 1;
    }

    .chat-toolbar-actions {
        width: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .quota-pill {
        min-height: 34px;
        padding: 0.25rem 0.7rem;
        font-size: 0.82rem;
    }

    .icon-text-btn {
        flex: 1;
        justify-content: center;
        min-height: 38px;
        padding: 0.4rem 0.65rem;
        font-size: 0.9rem;
    }

    .chat-toolbar-actions .icon-text-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
        flex: 0 0 40px;
        position: relative;
        display: block;
        border-radius: 50%;
        padding: 0;
        gap: 0;
        font-size: 0;
    }

    .chat-toolbar-actions .icon-text-btn i {
        font-size: 1rem;
        line-height: 1;
        display: block;
        position: absolute;
        left: 50%;
        top: calc(50% + 2px);
        transform: translate(-50%, -50%);
    }

    .sidebar-header {
        padding: max(0.8rem, env(safe-area-inset-top)) 0.8rem 0.8rem;
    }

    .conversation-list {
        padding: 0.45rem;
    }

    .conversation-item {
        padding: 0.55rem 0.45rem;
    }

    .conversation-item-title {
        font-size: 0.84rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversation-item-preview {
        min-height: 0;
        font-size: 0.74rem;
        -webkit-line-clamp: 1;
    }

    .conversation-item-time {
        font-size: 0.7rem;
    }

    .chat-messages {
        padding: 0.75rem 0.7rem 0.5rem;
    }

    .welcome-prompts {
        gap: 0.55rem;
        margin-top: 0.75rem;
    }

    .welcome-prompt-btn {
        padding: 0.7rem 0.8rem;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
    }

    .chat-input-area {
        gap: 5px;
        padding: 0.5rem 0.55rem;
    }

    .chat-input-row {
        gap: 0.6rem;
    }

    .chat-input-row input {
        min-height: 44px;
        padding: 0.7rem 0.85rem;
        font-size: 16px;
    }

    .chat-input-row button {
        width: 44px;
        flex-basis: 44px;
        min-height: 44px;
    }

    .chat-disclaimer-full {
        display: none;
    }

    .chat-disclaimer-short {
        display: inline;
    }

    .chat-disclaimer-text {
        font-size: 0.66rem;
        text-align: center;
        white-space: nowrap;
    }

    /* Profile */
    .profile-panel {
        margin: 1.2rem auto;
        padding: 1.15rem;
        border-radius: var(--radius-lg);
    }

    .profile-main {
        align-items: flex-start;
    }

    .profile-stats,
    .membership-plans,
    .quota-modal-plans,
    .quota-modal-stats {
        grid-template-columns: 1fr;
    }

    .order-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-item-side {
        text-align: left;
    }

    .invite-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .invite-open-btn {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }

    /* Payment modal */
    .payment-modal {
        align-items: flex-end;
        padding: 0;
    }

    .payment-modal-card {
        width: 100%;
        max-height: min(88dvh, 900px);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 1rem 0.9rem calc(0.95rem + env(safe-area-inset-bottom));
    }

    .payment-info-grid {
        grid-template-columns: 1fr;
    }

    .payment-modal-card h3 {
        font-size: 1.3rem;
        line-height: 1.35;
        padding-right: 2.1rem;
    }

    .payment-modal-copy,
    .payment-modal-note {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .payment-modal-section {
        margin-top: 0.9rem;
    }

    .payment-modal-section-title {
        margin-bottom: 0.55rem;
        font-size: 0.86rem;
    }

    .payment-platform-card,
    .payment-product-card,
    .payment-info-item {
        border-radius: var(--radius-sm);
    }

    .payment-platform-card,
    .payment-product-card,
    .payment-info-item {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .payment-product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .payment-product-meta strong {
        font-size: 1.15rem;
    }

    .payment-submit-btn {
        min-height: 48px;
        margin-top: 0.9rem;
    }

    /* Quota modal */
    .quota-modal-card {
        width: min(100%, 560px);
        max-height: min(90dvh, 760px);
        padding: 1.15rem;
    }

    .quota-modal-card h3 {
        font-size: 1.35rem;
        padding-right: 2rem;
    }

    .quota-modal-plan .auth-btn,
    .quota-modal-secondary {
        min-height: 46px;
    }
}

@media (max-width: 520px) {
    .quota-modal {
        align-items: flex-end;
        justify-content: stretch;
        padding: max(0.5rem, env(safe-area-inset-top)) 0 0;
    }

    .quota-modal-card {
        width: 100%;
        max-height: min(92dvh, 900px);
        margin-top: auto;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .quota-modal-card::before {
        content: "";
        display: block;
        width: 42px;
        height: 5px;
        margin: 0 auto 0.95rem;
        border-radius: var(--radius-full);
        background: var(--accent-light);
    }

    .quota-modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
    }

    .quota-modal-badge {
        font-size: 0.82rem;
        padding: 0.3rem 0.7rem;
    }

    .quota-modal-card h3 {
        margin-top: 0.8rem;
        font-size: 1.22rem;
        line-height: 1.3;
    }

    .quota-modal-copy,
    .quota-modal-note {
        margin-top: 0.55rem;
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .quota-modal-stats {
        gap: 0.65rem;
        margin-top: 0.85rem;
    }

    .quota-modal-stat {
        padding: 0.8rem 0.85rem;
        border-radius: var(--radius-sm);
    }

    .quota-modal-stat strong {
        font-size: 1.15rem;
    }

    .quota-modal-plans {
        gap: 0.7rem;
        margin-top: 0.85rem;
    }

    .quota-modal-plan {
        padding: 0.85rem;
        border-radius: var(--radius-sm);
    }

    .quota-modal-plan-price {
        font-size: 1.3rem;
    }

    .quota-modal-plan .auth-btn {
        min-height: 48px;
        margin-top: 0.8rem;
    }

    .quota-modal-secondary {
        width: 100%;
        justify-content: center;
        min-height: 46px;
        margin-top: 0.9rem;
    }
}

@media (max-width: 420px) {
    .chat-container {
        min-height: 0;
    }

    .conversation-sidebar {
        width: min(250px, 82vw);
    }

    .chat-toolbar-actions .icon-text-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .chat-current {
        width: auto;
    }

    .profile-main {
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .quota-modal-card {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .quota-modal-card h3 {
        font-size: 1.15rem;
    }

    .quota-modal-plan-name,
    .quota-modal-plan-quota,
    .quota-modal-copy,
    .quota-modal-note {
        font-size: 0.88rem;
    }
}

/* ═══════════════════════════════════════════════════════
   TEST ENTRY BANNER — 十二时辰人格测试入口
   ═══════════════════════════════════════════════════════ */

.test-entry-banner {
    max-width: 1120px;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--accent-light);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(193,102,75,0.04) 0%, rgba(193,102,75,0.01) 50%, rgba(155,74,53,0.04) 100%);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.test-entry-banner::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(193,102,75,0.06) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(40px, -40px);
    pointer-events: none;
}

.test-entry-banner:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.test-entry-banner:active {
    transform: translateY(0);
}

.test-entry-inner {
    padding: 1.4rem 1.6rem;
    position: relative;
    z-index: 1;
    text-align: center;
}

.test-entry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    background: var(--accent-glow);
    border: 1px solid var(--accent-light);
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
}

.test-entry-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.test-entry-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.test-entry-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.test-entry-meta span {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.test-entry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.4rem;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 12px rgba(193,102,75,0.2);
    transition: all 0.2s ease;
}

.test-entry-banner:hover .test-entry-btn {
    background: var(--accent-dark);
    box-shadow: 0 4px 16px rgba(155,74,53,0.3);
}

@media (max-width: 768px) {
    .test-entry-banner {
        margin: 0 0 1rem;
        border-radius: var(--radius-lg);
    }

    .test-entry-inner {
        padding: 1.1rem;
    }

    .test-entry-title {
        font-size: 1.1rem;
    }

    .test-entry-desc {
        font-size: 0.86rem;
    }

    .test-entry-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1rem;
    }
}

/* ── Check-in panel mobile ── */
@media (max-width: 420px) {
    .checkin-panel {
        align-items: flex-end;
        padding: 0.6rem;
    }
    .checkin-panel-card {
        width: 100%;
        border-bottom-left-radius: var(--radius-lg);
        border-bottom-right-radius: var(--radius-lg);
        padding: 1.4rem 1rem calc(1rem + env(safe-area-inset-bottom));
    }
    .checkin-day-circle {
        width: 32px;
        height: 32px;
        font-size: 0.72rem;
    }
    .checkin-day-label {
        font-size: 0.65rem;
    }
    .checkin-day-reward {
        font-size: 0.65rem;
    }
    .checkin-panel-week {
        gap: 0.2rem;
    }

    .checkin-banner {
        flex-wrap: nowrap;
        gap: 0.35rem;
        padding: 0.45rem 0.6rem;
        font-size: 0.78rem;
        border-radius: var(--radius-sm);
    }

    .checkin-banner-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .checkin-banner-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .checkin-banner-icon {
        flex-shrink: 0;
    }

    .checkin-banner-close {
        flex-shrink: 0;
    }
}
