/* ==========================================================================
   SUPER KAICHON — APPLE DESIGN SYSTEM CHAT INTERFACE
   Clean, Minimal, Modern, Quiet Luxury, Flat Surfaces, Precision Typography
   ========================================================================== */

:root {
    /* Apple Action Blue Accent */
    --apple-blue: #0066cc;
    --apple-blue-hover: #0071e3;
    --apple-blue-dark: #2997ff;
    --apple-blue-light: #edf5ff;
    --apple-blue-subtle: rgba(0, 102, 204, 0.08);

    /* Apple Neutral Palette */
    --canvas: #ffffff;
    --canvas-parchment: #f5f5f7;
    --canvas-pearl: #fafafc;
    --canvas-subtle: #fbfbfd;
    --canvas-card: #ffffff;

    /* Apple Ink & Typography */
    --ink: #1d1d1f;
    --ink-secondary: #424245;
    --ink-muted: #86868b;
    --ink-tertiary: #a1a1a6;

    /* Hairlines & Borders */
    --border-hairline: #e5e5ea;
    --border-subtle: #f0f0f2;
    --border-divider: #d2d2d7;

    /* System Status */
    --system-green: #34c759;
    --system-green-light: #eafaf1;
    --system-red: #ff3b30;
    --system-red-light: #fff2f2;
    --system-orange: #ff9500;

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* Subtle Elevation */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-focus: 0 0 0 3px rgba(0, 102, 204, 0.16);

    /* Typography scale */
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Prompt", "Noto Sans Thai", "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-stack);
    background-color: var(--canvas-parchment);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: hidden;
}

button,
input,
textarea {
    font-family: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   Active State for Locked Header Chat Icon
   ========================================================= */
.main-header .icon-btn.active,
.nav-actions .icon-btn.active {
    color: #ffffff !important;
    background: #1d1d1f !important;
    border-color: #1d1d1f !important;
    box-shadow: 0 4px 12px rgba(29, 29, 31, 0.2) !important;
}

/* =========================================================
   Chat Main Container (Below Fixed Header)
   ========================================================= */
.chat-main {
    width: min(100% - 32px, 1280px);
    max-width: 1280px;
    height: calc(100vh - 125px);
    height: calc(100dvh - 125px);
    margin: 104px auto 16px;
    padding: 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* =========================================================
   Chat Top Bar & Breadcrumb
   ========================================================= */
.chat-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    padding: 0 4px;
    flex-shrink: 0;
    min-width: 0;
}

.chat-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 400;
}

.chat-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ink-muted);
    transition: color 0.15s ease;
}

.chat-breadcrumb a:hover {
    color: var(--apple-blue);
}

.crumb-sep {
    color: var(--ink-tertiary);
    font-size: 0.68rem;
}

.crumb-current {
    color: var(--ink);
    font-weight: 600;
}

.chat-headline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-page-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.chat-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    color: var(--ink-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-subtle);
}

.badge-dot {
    width: 7px;
    height: 7px;
    background: var(--system-green);
    border-radius: 50%;
}

.rooms-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--ink);
    border: 0;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.rooms-toggle:hover {
    background: #000000;
}

.rooms-toggle:active {
    transform: scale(0.98);
}

/* =========================================================
   Chat 3-Column Layout Canvas
   ========================================================= */
.chat-layout {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 270px;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* =========================================================
   Panel Shared Styles
   ========================================================= */
.rooms-panel,
.conversation-panel,
.profile-panel {
    min-width: 0;
    min-height: 0;
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* Mobile Backdrop */
.rooms-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.rooms-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    border-radius: 50%;
    user-select: none;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-dot,
.online-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    background: var(--system-green);
    border-radius: 50%;
}

/* =========================================================
   1. Rooms Panel (Left Column)
   ========================================================= */
.rooms-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-right: 1px solid var(--border-hairline);
    background: var(--canvas-subtle);
    height: 100%;
    overflow: hidden;
}

.rooms-panel-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-hairline);
    background: var(--canvas-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title-text h2 {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.panel-badge-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-pill);
}

/* Mobile Drawer Close Button */
.rooms-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    color: var(--ink-secondary);
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.rooms-close:hover {
    background: var(--border-hairline);
    color: var(--ink);
}

.search-box-wrap {
    width: 100%;
}

/* Apple Pill Search Bar */
.search-box {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-muted);
    background: var(--canvas-parchment);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
    color: var(--apple-blue);
    background: var(--canvas);
    border-color: var(--apple-blue);
    box-shadow: var(--shadow-focus);
}

.search-box i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    min-width: 0;
    color: var(--ink);
    font-size: 0.84rem;
    background: transparent;
    border: 0;
    outline: 0;
}

.search-box input::placeholder {
    color: var(--ink-muted);
    font-weight: 400;
}

.room-list {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-bottom-left-radius: var(--radius-xl);
}

.room-item {
    position: relative;
    width: 100%;
    min-height: 68px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.room-item[hidden] {
    display: none !important;
}

.room-item:hover {
    background: var(--canvas-parchment);
}

.room-item.active {
    background: var(--canvas);
    border-color: var(--border-hairline);
    box-shadow: var(--shadow-subtle);
}

.room-item.active::before {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 3px;
    width: 3.5px;
    content: "";
    background: var(--apple-blue);
    border-radius: var(--radius-pill);
}

.avatar-room {
    width: 44px;
    height: 44px;
    font-size: 0.84rem;
    font-weight: 600;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    color: #ffffff;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.room-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.room-name,
.room-preview {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.room-name {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
}

.room-item.active .room-name {
    color: var(--ink);
    font-weight: 700;
}

.room-preview {
    color: var(--ink-muted);
    font-size: 0.76rem;
    line-height: 1.35;
    font-weight: 400;
}

.room-item.active .room-preview {
    color: var(--ink-secondary);
}

.room-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.room-time {
    align-self: flex-end;
    padding-top: 1px;
    color: var(--ink-tertiary);
    font-size: 0.68rem;
    font-weight: 400;
    white-space: nowrap;
}

.room-item.is-unread {
    background: #eef6ff;
    border-color: rgba(0, 102, 204, 0.22);
}

.room-item.is-unread:hover {
    background: #e3effe;
}

.room-item.is-unread .room-name {
    font-weight: 800;
    color: #0b1f3b;
}

.room-item.is-unread .room-preview.unread-preview {
    color: #005bb5;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.room-item.is-unread .room-preview.unread-preview::before {
    content: "•";
    font-size: 1.1em;
    line-height: 1;
    color: #ff3b30;
}

.room-item.is-unread .unread-time {
    color: #0066cc;
    font-weight: 700;
}

.room-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff3b30;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
    line-height: 1;
    letter-spacing: -0.02em;
    animation: unread-badge-pop 0.25s ease-out;
}

@keyframes unread-badge-pop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.panel-empty {
    margin: auto;
    padding: 36px 20px;
    color: var(--ink-muted);
    font-size: 0.84rem;
    line-height: 1.6;
    text-align: center;
}

.conversation-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--canvas);
    overflow: hidden;
}

.conversation-header {
    min-height: 64px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--border-hairline);
    background: var(--canvas);
    z-index: 5;
}

.partner-header-info {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    margin-left: -4px;
    color: var(--ink);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.chat-back-btn:hover {
    background: var(--canvas-parchment);
    color: var(--apple-blue);
}

.chat-back-btn:active {
    transform: scale(0.92);
}

.partner-avatar-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-main {
    width: 42px;
    height: 42px;
    font-size: 0.86rem;
    font-weight: 600;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    color: #ffffff;
    border-radius: 50%;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.partner-online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: var(--system-green);
    border: 2px solid var(--canvas);
    border-radius: 50%;
}

.conversation-person {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.conversation-person h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.partner-status-row {
    display: none !important;
}

.conversation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.header-more-dropdown {
    position: relative;
}

.chat-more-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    border-radius: 10px;
    color: var(--ink-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.chat-more-btn:hover {
    background: var(--canvas-parchment);
    border-color: rgba(0, 0, 0, 0.14);
    color: var(--ink);
}

.chat-more-btn:active {
    transform: scale(0.96);
}

.chat-more-btn:focus-visible {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}

.chat-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    border-radius: 12px;
    box-shadow: var(--shadow-floating);
    padding: 6px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: menu-pop 0.14s ease-out;
}

.chat-dropdown-menu[hidden] {
    display: none !important;
}

@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-menu-item {
    width: 100%;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border: none;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.chat-menu-item:hover {
    background: var(--canvas-parchment);
    color: var(--ink);
}

.chat-menu-item.text-danger {
    color: var(--system-red);
}

.chat-menu-item.text-danger:hover {
    background: var(--system-red-light);
    color: var(--system-red);
}

.chat-menu-item i {
    font-size: 0.92rem;
}

.connection-status {
    display: none !important;
}

/* Chat Alert */
.chat-alert {
    display: none;
    margin: 10px 16px 0;
    padding: 10px 14px;
    color: #991b1b;
    font-size: 0.78rem;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: var(--radius-sm);
}

.chat-alert:not(:empty) {
    display: block;
}

/* Chat Messages Box */
.chat-box {
    min-height: 0;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    background: var(--canvas);
}

.empty-message {
    margin: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ink-muted);
    font-size: 0.88rem;
    text-align: center;
    line-height: 1.6;
}

/* Message Rows & Bubbles (Clean Card Minimal Style) */
.message-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: message-fade 0.18s ease-out;
}

@keyframes message-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-row.mine {
    justify-content: flex-end;
}

.message-row.theirs {
    justify-content: flex-start;
}

.message-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.76rem;
    font-weight: 600;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    color: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.message-content-wrap {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    min-width: 0;
}

.theirs .message-content-wrap {
    align-items: flex-start;
}

.mine .message-content-wrap {
    align-items: flex-end;
}

.message-bubble-row {
    display: flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

.theirs .message-bubble-row {
    justify-content: flex-start;
}

.mine .message-bubble-row {
    justify-content: flex-end;
}

/* Clean Card Message Bubbles */
.message-bubble {
    width: fit-content;
    max-width: 100%;
    padding: 8px 14px;
    border-radius: 16px;
    position: relative;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Incoming Bubble (Theirs - Soft Light Gray) */
.theirs .message-bubble {
    color: #18181b;
    background: #f4f4f5;
    border: none;
}

/* Outgoing Bubble (Mine - Deep Black/Slate) */
.mine .message-bubble {
    color: #ffffff;
    background: #18181b;
    border: none;
}

.message-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    font-weight: 400;
}

/* Message Action Button (Hidden) */
.message-action-btn {
    display: none !important;
}

/* Clean Under-Bubble Timestamps */
.message-time {
    display: block;
    margin-top: 4px;
    padding: 0 4px;
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
    letter-spacing: 0.01em;
}

.theirs .message-time {
    text-align: left;
}

.mine .message-time {
    text-align: right;
}

/* =========================================================
   Floating Capsule Message Input Area
   ========================================================= */
.input-area {
    padding: 12px 18px 16px;
    background: var(--canvas);
    border-top: 1px solid var(--border-hairline);
    overflow: hidden;
}

.input-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 44px;
    padding: 6px 48px 6px 48px;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    border-radius: 22px;
    overflow: hidden;
    box-sizing: border-box;
    outline: none;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#share-chicken-btn {
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--apple-blue);
    font-size: 1.15rem;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

#share-chicken-btn:hover:not(:disabled) {
    background: rgba(0, 113, 227, 0.1);
    color: var(--apple-blue-hover);
    transform: scale(1.06);
}

#share-chicken-btn:active:not(:disabled) {
    transform: scale(0.95);
}

#share-chicken-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.input-container:focus-within,
.input-container:focus,
.input-container:focus-visible {
    background: var(--canvas);
    border-color: #d2d2d7;
    outline: none !important;
    box-shadow: none !important;
}

#message-input {
    display: block;
    width: 100%;
    min-height: 24px;
    height: 24px;
    max-height: 110px;
    margin: 4px 0;
    padding: 0;
    resize: none;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.4;
    background: transparent;
    border: 0;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
    overflow-y: hidden;
    overflow-x: hidden;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: var(--border-divider) transparent;
}

#message-input:focus,
#message-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

#message-input::-webkit-scrollbar {
    width: 4px;
}

#message-input::-webkit-scrollbar-thumb {
    background: var(--border-divider);
    border-radius: 4px;
}

#message-input::placeholder {
    color: var(--ink-muted);
    font-size: 0.86rem;
}

#send-btn {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    background: var(--apple-blue);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

#send-btn:hover:not(:disabled) {
    background: var(--apple-blue-hover);
    transform: scale(1.04);
}

#send-btn:active:not(:disabled) {
    transform: scale(0.96);
}

#send-btn:disabled {
    opacity: 0.4;
    background: var(--ink-muted);
    cursor: not-allowed;
    transform: none;
}

/* =========================================================
   3. Profile / Information Panel (Right Column) - Apple Settings Style
   ========================================================= */
.profile-panel {
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 1px solid var(--border-hairline);
    background: var(--canvas-subtle);
    overflow-y: auto;
    overflow-x: hidden;
    gap: 16px;
    height: 100%;
}

.profile-header-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
}

.profile-avatar-outer {
    position: relative;
    width: 76px;
    height: 76px;
    margin-bottom: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-profile {
    width: 76px;
    height: 76px;
    font-size: 1.35rem;
    font-weight: 600;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    color: #ffffff;
    border: 3px solid var(--canvas);
    box-shadow: var(--shadow-subtle);
}

.profile-active-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    background: var(--system-green);
    border: 2.5px solid var(--canvas);
    border-radius: 50%;
}

.profile-header-card h2 {
    width: 100%;
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-role-tag {
    margin: 0;
    padding: 3px 12px;
    color: var(--ink-secondary);
    font-size: 0.74rem;
    font-weight: 500;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-pill);
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.farm-profile-btn {
    width: 100%;
    margin-top: 14px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--apple-blue);
    background: var(--apple-blue-light);
    border: 1px solid rgba(0, 102, 204, 0.16);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.farm-profile-btn:hover {
    background: var(--apple-blue);
    color: #ffffff;
    border-color: var(--apple-blue);
}

.farm-profile-btn:active {
    transform: scale(0.98);
}

.farm-profile-btn:focus-visible {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}

.farm-profile-btn i {
    font-size: 0.88rem;
}

.profile-safety-notice {
    width: 100%;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    color: var(--ink-secondary);
    font-size: 0.74rem;
    line-height: 1.45;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
}

.profile-safety-notice i {
    font-size: 0.95rem;
    color: var(--apple-blue);
    flex-shrink: 0;
}

/* =========================================================
   Scrollbar Polish (Apple Minimalist)
   ========================================================= */
.room-list,
.chat-box,
.profile-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--border-divider) transparent;
}

.room-list::-webkit-scrollbar,
.chat-box::-webkit-scrollbar,
.profile-panel::-webkit-scrollbar {
    width: 5px;
}

.room-list::-webkit-scrollbar-thumb,
.chat-box::-webkit-scrollbar-thumb,
.profile-panel::-webkit-scrollbar-thumb {
    background: var(--border-divider);
    border-radius: 10px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   Responsive Design
   Desktop: >= 1069px (3-column layout)
   Tablet:  769px - 1068px (2-column layout)
   Mobile:  <= 768px (Full Screen View Switching: List <-> Chat)
   ========================================================= */

/* Tablet Breakpoint (769px - 1068px) */
@media (min-width: 769px) and (max-width: 1068px) {
    .chat-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .profile-panel {
        display: none !important;
    }

    .chat-back-btn {
        display: none !important;
    }
}

/* Mobile Breakpoint (<= 768px) — Full View Switching & Clean Mobile Navbar */
@media (max-width: 768px) {
    /* Mobile Header Layout (Space-Between: Hamburger Left, Actions Right) */
    .main-header {
        top: 10px;
        width: calc(100% - 20px);
    }

    .main-header .main-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 58px;
        padding: 0 8px 0 10px;
        width: 100%;
        gap: 0;
    }

    /* 1. Hide "SUPER KAICHON" brand logo text on mobile */
    .main-header .logo {
        display: none !important;
    }

    /* 2. Hamburger button on far left */
    .main-header .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0;
        margin: 0;
        color: var(--ink);
        background: var(--canvas-parchment);
        border: 1px solid var(--border-hairline);
        border-radius: 50%;
        font-size: 1.25rem;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }

    .main-header .mobile-menu-btn:hover {
        background: var(--border-hairline);
        color: var(--ink);
    }

    .main-header .mobile-menu-btn:active {
        transform: scale(0.94);
    }

    /* 3. Actions group on far right */
    .main-header .nav-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    .main-header .nav-actions .icon-btn {
        display: inline-flex;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .main-header .user-profile {
        width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 50%;
    }

    .main-header .user-avatar {
        width: 38px;
        height: 38px;
    }

    /* Mobile Navigation Dropdown Menu (Toggle via Hamburger 3-line button -> Horizontal 3-Capsule Pill Bar) */
    .main-header .nav-menu {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 4px !important;
        display: none !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        border: 1px solid rgba(226, 232, 240, 0.95) !important;
        border-radius: 999px !important;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
        z-index: 1050 !important;
        animation: mobile-nav-slide 0.18s ease-out !important;
    }

    .main-header .nav-menu.show {
        display: grid !important;
    }

    .main-header .nav-menu li {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .main-header .nav-menu a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 7px 4px !important;
        color: #64748b !important;
        background: #f1f5f9 !important;
        border-radius: 999px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        text-align: center !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
        border: none !important;
        box-shadow: none !important;
    }

    .main-header .nav-menu a:hover,
    .main-header .nav-menu a:active {
        color: #0f172a !important;
        background: #e2e8f0 !important;
    }

    .main-header .nav-menu a.active {
        color: #0f172a !important;
        background: #ffffff !important;
        font-weight: 700 !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10) !important;
    }

    @keyframes mobile-nav-slide {
        from { opacity: 0; transform: translateY(-6px) scale(0.98); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .chat-main {
        width: calc(100% - 16px);
        height: calc(100vh - 128px);
        height: calc(100dvh - 128px);
        margin: 118px auto calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .rooms-panel-header {
        padding: 12px 14px 10px !important;
        gap: 10px !important;
    }

    /* 1. Hide "แชตข้อความ" top bar completely on mobile */
    .chat-top-bar {
        display: none !important;
    }

    /* Hide drawer buttons & modal overlay */
    .rooms-toggle,
    .rooms-close,
    .rooms-backdrop {
        display: none !important;
    }

    .chat-layout {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        border-radius: var(--radius-lg);
        height: 100%;
        min-height: 0;
        width: 100%;
        position: relative;
    }

    /* 1. List View: Show rooms panel full-screen, hide conversation */
    .chat-layout:not(.view-chat) .rooms-panel {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        width: 100%;
        height: 100%;
        border-right: none;
        position: static;
        max-width: none;
        background: var(--canvas);
        box-shadow: none;
        border-radius: inherit;
    }

    .chat-layout:not(.view-chat) .conversation-panel,
    .chat-layout:not(.view-chat) .profile-panel {
        display: none !important;
    }

    /* 2. Chat View: Show conversation panel full-screen, hide rooms & profile */
    .chat-layout.view-chat .conversation-panel {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        width: 100%;
        height: 100%;
        background: var(--canvas);
        border-radius: inherit;
    }

    .chat-layout.view-chat .rooms-panel,
    .chat-layout.view-chat .profile-panel {
        display: none !important;
    }

    .chat-layout.view-chat .chat-back-btn {
        display: inline-flex;
    }

    .conversation-header {
        min-height: 56px;
        height: auto;
        padding: 6px 12px;
    }

    .avatar-main {
        width: 38px;
        height: 38px;
    }

    .chat-box {
        padding: 14px 12px;
        gap: 16px;
    }

    .message-content-wrap {
        max-width: 80%;
    }

    .message-bubble {
        width: fit-content;
        max-width: 100%;
        padding: 8px 13px;
        border-radius: 14px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .message-text {
        font-size: 13.5px;
        line-height: 1.4;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }

    .message-action-btn {
        display: none !important;
    }

    .input-area {
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
        overflow: hidden;
    }

    .input-container {
        display: flex;
        align-items: flex-end;
        min-height: 42px;
        padding: 4px 44px 4px 44px;
        border-radius: 21px;
        overflow: hidden;
        box-sizing: border-box;
    }

    #share-chicken-btn {
        left: 3px;
        bottom: 3px;
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
    }

    #message-input {
        min-height: 24px;
        height: 24px;
        max-height: 100px;
        margin: 4px 0;
        padding: 0;
        font-size: 0.92rem;
        line-height: 1.35;
        box-sizing: border-box;
    }

    #send-btn {
        position: absolute;
        right: 3px;
        bottom: 3px;
        width: 34px;
        height: 34px;
    }
}

/* Micro screens (<= 480px) */
@media (max-width: 480px) {
    .chat-main {
        width: calc(100% - 12px);
        height: calc(100vh - 80px);
        height: calc(100dvh - 80px);
        margin: 72px auto calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .chat-breadcrumb {
        display: none;
    }

    .chat-layout {
        border-radius: var(--radius-md);
    }

    .message-content-wrap {
        max-width: 82%;
    }

    .message-bubble {
        width: fit-content;
        max-width: 100%;
        font-size: 13.5px;
    }

    .connection-status {
        display: none;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   Share Chicken Modal
   ========================================================= */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal[hidden] {
    display: none !important;
}

.share-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.share-modal-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--canvas);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-hairline);
    overflow: hidden;
    animation: shareModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-hairline);
}

.share-modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.share-modal-title-group i {
    font-size: 1.25rem;
    color: var(--apple-blue);
}

.share-modal-title-group h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.share-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--canvas-parchment);
    color: var(--ink-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.share-modal-close:hover {
    background: var(--border-hairline);
    color: var(--ink);
}

.share-modal-search {
    position: relative;
    padding: 12px 20px;
    background: var(--canvas-parchment);
    border-bottom: 1px solid var(--border-hairline);
}

.share-modal-search i {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.share-modal-search input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border-radius: 12px;
    border: 1px solid var(--border-hairline);
    background: var(--canvas);
    font-size: 0.9rem;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.share-modal-search input:focus {
    border-color: var(--apple-blue);
}

.share-modal-body {
    padding: 14px 20px;
    overflow-y: auto;
    max-height: 55vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-chicken-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    border-radius: 14px;
    transition: all 0.18s ease;
}

.share-chicken-card:hover {
    border-color: var(--apple-blue);
    background: var(--canvas);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.share-chicken-info-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.share-chicken-thumb {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
}

.share-chicken-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-chicken-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-chicken-sub {
    font-size: 0.8rem;
    color: var(--ink-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-chicken-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: #10b981;
}

.share-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: 999px;
    border: none;
    background: var(--apple-blue);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.share-item-btn:hover {
    background: var(--apple-blue-hover);
    transform: scale(1.03);
}

.share-chicken-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.share-item-preview-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--canvas);
    border: 1px solid var(--border-hairline);
    color: var(--ink-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.share-item-preview-btn:hover {
    background: var(--border-hairline);
    color: var(--apple-blue);
    transform: scale(1.05);
}

.share-modal-loading,
.share-modal-empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

/* Clickable detail button inside chat bubble */
.chat-chicken-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theirs .chat-chicken-detail-btn {
    background: var(--apple-blue);
    color: #ffffff !important;
}

.theirs .chat-chicken-detail-btn:hover {
    background: var(--apple-blue-hover);
    transform: translateY(-1px);
}

.mine .chat-chicken-detail-btn {
    background: #ffffff;
    color: #18181b !important;
}

.mine .chat-chicken-detail-btn:hover {
    background: #f4f4f5;
    transform: translateY(-1px);
}

/* =========================================================
   In-Chat Chicken Detail Popup Modal
   ========================================================= */
.chicken-detail-popup-container {
    max-width: 480px;
    border-radius: 24px;
}

.chicken-detail-popup-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    max-height: 75vh;
}

.chicken-popup-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chicken-popup-img-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
}

.chicken-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chicken-popup-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chicken-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chicken-popup-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink);
}

.chicken-popup-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #10b981;
}

.chicken-popup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.chicken-popup-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
}

.chicken-popup-field .field-label {
    font-size: 0.75rem;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chicken-popup-field .field-value {
    font-size: 0.88rem;
    color: var(--ink);
    font-weight: 700;
}

.chicken-popup-farm-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    border-radius: 14px;
}

.chicken-popup-farm-box i {
    font-size: 1.25rem;
    color: var(--apple-blue);
}

.farm-box-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.farm-box-text small {
    font-size: 0.72rem;
    color: var(--ink-muted);
}

.farm-box-text strong {
    font-size: 0.88rem;
    color: var(--ink);
}

.chicken-popup-history {
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
}

.history-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #d97706;
    margin-bottom: 4px;
}

.history-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ink);
    line-height: 1.4;
}

.chicken-popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.chicken-popup-market-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    border-radius: 12px;
    background: var(--apple-blue);
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.chicken-popup-market-btn:hover {
    background: var(--apple-blue-hover);
    transform: translateY(-1px);
}

.chicken-popup-close-btn {
    padding: 11px 18px;
    border-radius: 12px;
    background: var(--canvas-parchment);
    border: 1px solid var(--border-hairline);
    color: var(--ink-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chicken-popup-close-btn:hover {
    background: var(--border-hairline);
    color: var(--ink);
}

