/**
 * RTP Legal Consultation Flow - Main Stylesheet (Modernized)
 * * Updated: 2026-01-18
 * - Introduced CSS Variables
 * - Modern UI/UX (Inter font, gradients, shadows)
 * - Improved Mobile Responsiveness
 */

/* ---------------------------------------------------------
   0. CSS Variables & Root Settings
--------------------------------------------------------- */
:root {
    /* Color Palette */
    --rtp-primary: #0F172A;       /* 知的なダークネイビー（ヘッダー文字など） */
    --rtp-accent: #3B82F6;        /* 鮮やかなテックブルー（主要アクション） */
    --rtp-accent-hover: #2563EB;  /* アクセントのホバー色 */
    --rtp-success: #10B981;       /* 成功・合意（グリーン） */
    --rtp-warning: #F59E0B;       /* 注意・保留（オレンジ） */
    --rtp-danger: #EF4444;        /* 警告・破棄（レッド） */
    
    /* Backgrounds */
    --rtp-bg: #F3F4F6;            /* アプリケーション背景 */
    --rtp-surface: #FFFFFF;       /* カード・パネル背景 */
    --rtp-bg-chat: #F8FAFC;       /* チャットエリア背景 */
    
    /* Text Colors */
    --rtp-text-main: #1F2937;
    --rtp-text-sub: #6B7280;
    --rtp-text-placeholder: #9CA3AF;

    /* Borders & UI */
    --rtp-border: #E5E7EB;
    --rtp-radius: 8px;            /* ボタン・入力欄の角丸 */
    --rtp-radius-lg: 12px;        /* コンテナの角丸 */
    --rtp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rtp-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);

    /* Fonts */
    --rtp-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --rtp-font-serif: "Times New Roman", Times, serif; /* 契約書用 */
}

/* ---------------------------------------------------------
   1. Dashboard Styles (案件一覧)
--------------------------------------------------------- */
.rtp-dashboard-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: var(--rtp-font-family);
    color: var(--rtp-text-main);
}

.rtp-dashboard-wrapper h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: var(--rtp-primary);
}

.rtp-table-responsive {
    overflow-x: auto;
    border: 1px solid var(--rtp-border);
    border-radius: var(--rtp-radius);
    background: var(--rtp-surface);
    box-shadow: var(--rtp-shadow-sm);
}

.rtp-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.rtp-dashboard-table th,
.rtp-dashboard-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--rtp-border);
    vertical-align: middle;
}

.rtp-dashboard-table th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: var(--rtp-text-sub);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rtp-dashboard-table tr:last-child td {
    border-bottom: none;
}

.rtp-dashboard-table tr:hover td {
    background-color: #F9FAFB;
}

/* Status Pills */
.rtp-status-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    background-color: #e5e5e5;
    color: var(--rtp-text-sub);
}

.rtp-status-pill.case_active,
.rtp-status-pill.contract_agreed,
.rtp-status-pill.nda_agreed {
    background-color: #ECFDF5;
    color: var(--rtp-success);
}

.rtp-status-pill.pending,
.rtp-status-pill.nda_negotiation,
.rtp-status-pill.contract_negotiation {
    background-color: #FFFBEB;
    color: var(--rtp-warning); /* Darker yellow for text visibility */
}

.rtp-status-pill.terminated {
    background-color: #FEF2F2;
    color: var(--rtp-danger);
}

.rtp-role-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    background: var(--rtp-bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--rtp-text-sub);
    border: 1px solid var(--rtp-border);
}

/* ---------------------------------------------------------
   2. Consultation Room Layout (チャットルーム)
--------------------------------------------------------- */
.rtp-consultation-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    background-color: var(--rtp-bg);
    border: none;
    box-shadow: none;
    border-radius: var(--rtp-radius-lg);
    min-height: 600px;
    display: flex;
    flex-direction: column;
    font-family: var(--rtp-font-family);
    color: var(--rtp-text-main);
    overflow: hidden; /* 角丸を効かせるため */
}

/* Header */
.rtp-room-header {
    background: var(--rtp-surface);
    border-bottom: 1px solid var(--rtp-border);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rtp-header-top {
    /* 旧スタイルの互換性維持（基本はflexコンテナ内で処理） */
    display: flex; 
    flex-direction: column;
}

.rtp-case-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--rtp-primary);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.rtp-case-id {
    font-size: 12px;
    color: var(--rtp-text-sub);
    font-weight: 400;
    margin-top: 4px;
}

/* Toolbar & Status Bar */
.rtp-status-bar {
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rtp-status-bar.rtp-status-terminated {
    /* 終了時は背景色をつける */
    background-color: #FEF2F2;
    padding: 5px 15px;
    border-radius: 20px;
    color: var(--rtp-danger);
}

.rtp-header-alert {
    font-weight: bold;
    color: var(--rtp-danger);
    font-size: 13px;
    background: #FEF2F2;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Tool Buttons (Reload etc) */
.rtp-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--rtp-border);
    background: var(--rtp-surface);
    color: var(--rtp-text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.rtp-tool-btn:hover {
    background: #F9FAFB;
    color: var(--rtp-accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Main Grid (2 Columns) */
.rtp-room-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 700px;
    background: var(--rtp-surface);
}

/* ---------------------------------------------------------
   3. Document Column (Left Side)
--------------------------------------------------------- */
.rtp-doc-column {
    flex: 1;
    border-right: 1px solid var(--rtp-border);
    display: flex;
    flex-direction: column;
    background-color: #F9FAFB; /* ドキュメントエリアは少しグレー */
    min-width: 0;
}

/* Tabs */
.rtp-doc-tabs {
    display: flex;
    background: var(--rtp-surface);
    border-bottom: 1px solid var(--rtp-border);
    padding: 0 10px;
}

.rtp-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rtp-text-sub);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.rtp-tab-btn:hover {
    color: var(--rtp-primary);
    background-color: #F3F4F6;
}

.rtp-tab-btn.active {
    color: var(--rtp-accent);
    border-bottom-color: var(--rtp-accent);
    background-color: transparent;
}

/* Icon Buttons for Maximize */
.rtp-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    color: var(--rtp-text-sub);
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}
.rtp-icon-btn:hover {
    color: var(--rtp-accent);
}

/* Doc Panel */
.rtp-doc-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px;
}

.rtp-doc-panel.active {
    display: flex;
}

.rtp-doc-content-wrapper {
    flex: 1;
    margin-bottom: 24px;
}

/* Paper Style (A4 simulation) */
.rtp-doc-paper {
    background: #fff;
    padding: 40px;
    box-shadow: var(--rtp-shadow);
    border: 1px solid var(--rtp-border);
    border-radius: 4px; /* 紙っぽさ */
    
    font-family: var(--rtp-font-serif) !important;
    line-height: 1.8;
    font-size: 15px;
    color: #111;
    max-width: 800px;
    margin: 0 auto;
}

.rtp-doc-paper p, .rtp-doc-paper h2, .rtp-doc-paper h3, .rtp-doc-paper li {
    font-family: var(--rtp-font-serif) !important;
}

.rtp-doc-paper h2 { font-size: 22px; text-align: center; margin-bottom: 24px; font-weight: bold; }
.rtp-doc-paper h3 { font-size: 17px; margin-top: 20px; margin-bottom: 12px; font-weight: bold; }
.rtp-doc-paper p { margin-bottom: 16px; text-align: justify; }

/* Placeholders */
.rtp-placeholder {
    font-weight: bold;
    text-decoration: underline;
    background-color: #FEF3C7; /* 薄い黄色 */
    padding: 0 4px;
}

.rtp-placeholder-filled {
    font-weight: bold;
    text-decoration: underline;
    color: #000;
}

/* Action Buttons Area */
.rtp-doc-actions, .rtp-payment-action-area {
    background: var(--rtp-surface);
    border: 1px solid var(--rtp-border);
    border-radius: var(--rtp-radius);
    padding: 20px;
    box-shadow: var(--rtp-shadow);
    margin: 0 auto 15px auto;
    width: 100%;
    max-width: 800px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    box-sizing: border-box;
    text-align: center;
}

/* Action Banners */
.rtp-action-banner-primary {
    background: #EFF6FF; /* 薄い青 */
    border: 1px solid #BFDBFE;
    border-left: 5px solid var(--rtp-accent);
    border-radius: var(--rtp-radius);
    padding: 20px;
    margin: 0 auto 20px auto;
    max-width: 800px;
    box-shadow: var(--rtp-shadow-sm);
    text-align: center;
}

.rtp-action-banner-primary h3 {
    color: var(--rtp-primary);
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

/* Button Styles (Modern) */
.rtp-btn, .button.button-primary, .button.button-secondary {
    padding: 10px 20px;
    border-radius: var(--rtp-radius);
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.1s, box-shadow 0.2s, background-color 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.4;
}

/* Primary Action */
.rtp-btn-primary, .button.button-primary, .rtp-btn-agree {
    background: var(--rtp-accent) !important;
    color: #fff !important;
    border: none !important;
}

.rtp-btn-primary:hover, .rtp-btn-agree:hover, .button.button-primary:hover {
    background: var(--rtp-accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

/* Secondary Action / Revise */
.rtp-btn-revise, .button.button-secondary {
    background: #fff !important;
    border: 1px solid var(--rtp-border) !important;
    color: var(--rtp-text-main) !important;
}

.rtp-btn-revise:hover, .button.button-secondary:hover {
    background: #F9FAFB !important;
    color: var(--rtp-danger) !important; /* 修正は赤系のホバー */
    border-color: var(--rtp-danger) !important;
}

/* Status Banners inside Doc */
.rtp-doc-status-banner {
    padding: 12px 16px;
    border-radius: var(--rtp-radius);
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}
.rtp-doc-status-banner.agreed {
    background-color: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: var(--rtp-success);
}
.rtp-doc-status-banner.pending {
    background-color: #F3F4F6;
    border: 1px solid var(--rtp-border);
    color: var(--rtp-text-sub);
}

/* Files Table */
.rtp-files-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.rtp-files-table th, 
.rtp-files-table td {
    padding: 12px;
    border-bottom: 1px solid var(--rtp-border);
    text-align: left;
    font-size: 13px;
}
.rtp-files-table th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--rtp-text-main);
}
.rtp-files-table tr:hover {
    background-color: #F9FAFB;
}

/* ---------------------------------------------------------
   4. Chat Column (Right Side)
--------------------------------------------------------- */
.rtp-chat-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--rtp-bg-chat); /* 少しグレー */
}

/* Timeline */
.rtp-chat-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rtp-chat-date {
    text-align: center;
    font-size: 11px;
    color: var(--rtp-text-sub);
    margin: 10px 0;
    position: relative;
    font-weight: 500;
}
.rtp-chat-date::before, .rtp-chat-date::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--rtp-border);
    vertical-align: middle;
    margin: 0 10px;
}

/* Chat Bubbles */
.rtp-chat-bubble {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    box-shadow: var(--rtp-shadow-sm);
}

/* My Message */
.rtp-msg-me {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--rtp-accent), var(--rtp-accent-hover));
    color: #fff;
    border-bottom-right-radius: 4px;
    border: none;
}
.rtp-msg-me a { color: #fff; text-decoration: underline; }

/* Partner Message */
.rtp-msg-partner {
    align-self: flex-start;
    background-color: var(--rtp-surface);
    color: var(--rtp-text-main);
    border: 1px solid var(--rtp-border);
    border-bottom-left-radius: 4px;
}

/* System Message */
.rtp-system-message {
    align-self: center;
    background-color: #FFFBEB;
    color: #B45309;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #FCD34D;
    width: auto;
    max-width: 90%;
    margin: 10px 0;
}
.rtp-sys-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Masked Text */
.rtp-masked-text {
    font-style: italic;
    opacity: 0.7;
}

/* Meta / Timestamp */
.rtp-msg-meta {
    font-size: 11px;
    margin-top: 4px;
    text-align: right;
    opacity: 0.8;
}

/* Input Area */
.rtp-chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--rtp-border);
    background: var(--rtp-surface);
}

#rtp-chat-textarea {
    width: 100%;
    border: 1px solid var(--rtp-border);
    border-radius: var(--rtp-radius);
    padding: 12px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 12px;
    background: #F9FAFB;
    transition: all 0.2s;
}

#rtp-chat-textarea:focus {
    background: #fff;
    border-color: var(--rtp-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.rtp-chat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rtp-attach-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rtp-attach-btn {
    cursor: pointer;
    color: var(--rtp-text-sub);
    font-size: 20px;
    transition: color 0.2s;
}
.rtp-attach-btn:hover { color: var(--rtp-accent); }

.rtp-send-btn {
    background: var(--rtp-primary);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.rtp-send-btn:hover { background: #000; }
.rtp-send-btn:disabled {
    background: var(--rtp-text-placeholder);
    cursor: not-allowed;
}

/* Footer Actions (Termination) */
.rtp-footer-actions {
    text-align: center;
    padding: 12px;
    background: var(--rtp-bg);
    border-top: 1px solid var(--rtp-border);
}
.rtp-terminate-link {
    background: none;
    border: 1px solid transparent;
    color: var(--rtp-text-sub);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}
.rtp-terminate-link:hover {
    background: #FEF2F2;
    color: var(--rtp-danger);
}

/* ---------------------------------------------------------
   5. Modals
--------------------------------------------------------- */
.rtp-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px); /* モダンなぼかし効果 */
    align-items: center;
    justify-content: center;
}

.rtp-modal.active {
    display: flex;
}

.rtp-modal-content {
    background-color: var(--rtp-surface);
    padding: 32px;
    border-radius: var(--rtp-radius-lg);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.rtp-modal-content.large {
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.rtp-close-modal {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 24px;
    color: var(--rtp-text-placeholder);
    cursor: pointer;
    transition: color 0.2s;
}
.rtp-close-modal:hover { color: var(--rtp-text-main); }

.rtp-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid var(--rtp-border);
    padding-bottom: 15px;
    color: var(--rtp-primary);
}

/* Diff Viewer in Modal */
.rtp-diff-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #F9FAFB;
    padding: 12px;
    border-radius: var(--rtp-radius);
    margin-bottom: 15px;
    border: 1px solid var(--rtp-border);
}

.rtp-diff-viewer {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--rtp-border);
    background: #fff;
    font-family: monospace;
    line-height: 1.6;
    /* ▼▼▼ 重要: これがないと改行が無視されます ▼▼▼ */ 
    white-space: pre-wrap; 
    word-break: break-word; /* 長い単語でレイアウト崩れを防ぐ */
    /* ▲▲▲ */
    border-radius: 4px;
}

/* Loading State */
.rtp-loading-cursor {
    cursor: wait !important;
}

/* ---------------------------------------------------------
   6. Progress Bar Styles (Refreshed)
--------------------------------------------------------- */
.rtp-progress-bar-container {
    padding: 24px 40px;
    background: var(--rtp-surface);
    border-bottom: 1px solid var(--rtp-border);
}

.rtp-progressbar {
    margin: 0;
    padding: 0;
    counter-reset: step;
    display: flex;
    justify-content: space-between;
    list-style: none;
}

.rtp-progressbar li {
    position: relative;
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--rtp-text-placeholder);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Circle */
.rtp-progressbar li:before {
    content: counter(step);
    counter-increment: step;
    width: 30px;
    height: 30px;
    line-height: 28px;
    display: block;
    margin: 0 auto 8px auto;
    border-radius: 50%;
    background: var(--rtp-surface);
    border: 2px solid var(--rtp-border);
    color: var(--rtp-text-placeholder);
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
    position: relative;
    transition: all 0.3s ease;
}

/* Connecting Line */
.rtp-progressbar li:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--rtp-border);
    top: 15px; /* Circle(30)/2 */
    left: -50%;
    z-index: -1;
    transition: background 0.3s ease;
}

.rtp-progressbar li:first-child:after {
    content: none;
}

/* Active / Completed State */
.rtp-progressbar li.active {
    color: var(--rtp-accent);
}

.rtp-progressbar li.active:before {
    border-color: var(--rtp-accent);
    background: var(--rtp-accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); /* 光彩効果 */
}

.rtp-progressbar li.active:after {
    background: var(--rtp-accent);
}

/* ---------------------------------------------------------
   7. Start Consultation Form
--------------------------------------------------------- */
.rtp-start-consultation-wrapper {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: var(--rtp-surface);
    border: 1px solid var(--rtp-border);
    border-radius: var(--rtp-radius-lg);
    box-shadow: var(--rtp-shadow);
}

.rtp-start-consultation-wrapper h2 {
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 1px solid var(--rtp-border);
    padding-bottom: 15px;
    color: var(--rtp-primary);
}

.rtp-form-group {
    margin-bottom: 24px;
}

.rtp-form-group label {
    display: block; 
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--rtp-text-main);
}

.rtp-form-group input[type="text"],
.rtp-form-group textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
    padding: 12px;
    border: 1px solid var(--rtp-border);
    border-radius: var(--rtp-radius);
    background: #F9FAFB;
}
.rtp-form-group input[type="text"]:focus,
.rtp-form-group textarea:focus {
    background: #fff;
    border-color: var(--rtp-accent);
    outline: none;
}

/* ---------------------------------------------------------
   8. Editor Height Fix in Modal
--------------------------------------------------------- */
#rtp-revision-modal .wp-editor-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#rtp-revision-modal .wp-editor-container {
    flex: 1;
    border: 1px solid #ddd;
}

#rtp-revision-modal .mce-edit-area,
#rtp-revision-modal .mce-edit-area iframe {
    height: 60vh !important;
    min-height: 400px !important;
}

#rtp-revision-modal textarea.wp-editor-area {
    height: 60vh !important;
    min-height: 400px !important;
}

#rtp-revision-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ---------------------------------------------------------
   9. Expand / Maximize Views
--------------------------------------------------------- */

/* Document Fullscreen */
.rtp-doc-column.rtp-is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;
    background: #F9FAFB;
    border: none;
    padding: 20px;
    box-sizing: border-box;
}

.rtp-doc-column.rtp-is-fullscreen .rtp-doc-tabs {
    background: var(--rtp-surface);
    padding: 0 10px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

/* Chat Fullscreen */
.rtp-room-layout.rtp-chat-expanded .rtp-doc-column {
    display: none !important;
}

.rtp-room-layout.rtp-chat-expanded .rtp-chat-column {
    width: 100% !important;
    flex: 1 1 100% !important;
    border-left: none;
}

/* ---------------------------------------------------------
   10. Responsive
--------------------------------------------------------- */
@media (max-width: 768px) {
    .rtp-room-layout {
        flex-direction: column;
        height: auto;
    }

    .rtp-doc-column, .rtp-chat-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--rtp-border);
    }

    .rtp-doc-panel {
        max-height: 400px;
    }

    .rtp-chat-timeline {
        height: 400px;
    }
    
    .rtp-consultation-wrapper {
        border-radius: 0;
        margin: 0;
    }
    
    .rtp-progressbar li {
        font-size: 9px;
    }
}

/* Loading Animation */
@keyframes rtp-spin {
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
.spin {
    animation: rtp-spin 2s infinite linear;
}
