/* Squad document styles */
.loading-state, .error-state {
    text-align: center;
    padding: 3rem;
}

.loading-state {
    color: #6b7280;
}

.error-state {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 2rem 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #3182ce;
}

/* Role-based styles for squad documents */
.role-decision-maker { display: none; }
.role-squad-view { display: none; }
.role-opinion-giver { display: none; }
.role-viewer { display: none; }

body.decision-maker .role-decision-maker,
body.squad-view .role-squad-view,
body.opinion-giver .role-opinion-giver,
body.viewer .role-viewer {
    display: block;
}

.decision-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-option input[type="radio"] {
    transform: scale(1.1);
}

.radio-option.approved { color: #10b981; }
.radio-option.rejected { color: #ef4444; }
.radio-option.approved-conditions { color: #f59e0b; }

/* Responsive back button */
.back-button {
    position: relative;
}

/* Investment Process Dashboard Styles - Based on Demo */
.investment-header {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    position: relative;
}

.investment-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.03em;
    color: #1a202c;
}

.investment-header .page-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.65;
}

#squad-documents-page .month-selector {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 1rem;
    max-width: calc(100% - 6rem);
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: inherit !important;
    cursor: default !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

#squad-doc-page .squad-month-nav {
    position: absolute !important;
    top: 0.125rem !important;
    right: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem !important;
    border: 1px solid #d1d5db !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
    cursor: default !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    height: 2.75rem !important;
    box-sizing: border-box !important;
    justify-content: center !important;
}

#squad-doc-page .squad-month-nav:hover {
    background: #e5e7eb !important;
    transform: translateY(-1px) !important;
}

.squad-doc-content-wrapper {
    position: relative;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem;
}

.month-nav button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.month-nav button:hover:not(:disabled) {
    background: #f3f4f6;
}

.month-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.month-display {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    min-width: 80px;
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.squad-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 220px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.squad-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12), 0 3px 6px rgba(0,0,0,0.08);
}

/* No blue outline for draft cards since we can't reliably detect saved vs unsaved */

.squad-card.approved {
    border-color: #10b981;
    background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}

.squad-card.approved-conditions {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.squad-card.approved-with-conditions {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.squad-card.draft {
    border-color: #d1d5db;
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
}

.squad-card.ready-for-decision {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.squad-card.rejected {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.squad-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.squad-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
}

.investment-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.investment-card-headline {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
    margin-bottom: 2rem;
}

.investment-card-footer {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    max-width: calc(100% - 2rem);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.status-badge.approved {
    background: #10b981;
    color: white;
}

.status-badge.approved-conditions {
    background: #f59e0b;
    color: white;
}

.status-badge.approved-with-conditions {
    background: #f59e0b;
    color: white;
}

.status-badge.approved_with_conditions {
    background: #f59e0b;
    color: white;
}

/* Style cards with approved_with_conditions status to have gold/orange border and subtle background */
.squad-card.approved_with_conditions {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.squad-card.approved_with_conditions:hover {
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.status-badge.draft {
    background: #6b7280;
    color: white;
}

.status-badge.ready-for-decision {
    background: #f59e0b;
    color: white;
}

.status-badge.rejected {
    background: #ef4444;
    color: white;
}

/* Role-based status badges */
.status-badge.opinion-requested {
    background: #f59e0b;
    color: white;
}

.status-badge.opinion-given {
    background: #10b981;
    color: white;
}

.status-badge.opinions-pending {
    background: #3b82f6;
    color: white;
}

/* Status for when squad has submitted but using existing ready-for-decision styling */
.status-badge.submitted {
    background: #8b5cf6;
    color: white;
}

/* Squad card styles for role-based statuses */
.squad-card.opinion-requested {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.squad-card.opinion-requested:hover {
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.squad-card.opinion-given {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.squad-card.opinion-given:hover {
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.squad-card.opinions-pending {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.squad-card.opinions-pending:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.squad-card.submitted {
    border: 2px solid #8b5cf6;
    background: linear-gradient(135deg, #ede9fe 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.squad-card.submitted:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.opinion-giver-section {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.opinion-giver-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem 0;
}

.opinion-giver-section p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
}

.opinion-giver-button {
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.opinion-giver-button:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

/* Override original squad card styles for the new design */
.squad-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.squad-cards-grid .squad-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 220px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.squad-cards-grid .squad-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12), 0 3px 6px rgba(0,0,0,0.08);
}

/* No blue outline for draft cards since we can't reliably detect saved vs unsaved */

.squad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.squad-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    line-height: 1.4;
}

.squad-card-month {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.squad-card-headline {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 2.5rem 0;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.squad-card-footer {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: calc(100% - 2rem);
}

.squad-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.squad-status-badge.approved {
    background: #10b981;
    color: white;
}

.squad-status-badge.approved-conditions {
    background: #f59e0b;
    color: white;
}

.squad-status-badge.approved-with-conditions {
    background: #f59e0b;
    color: white;
}

.squad-status-badge.draft {
    background: #6b7280;
    color: white;
}

.squad-status-badge.ready-for-decision {
    background: #f59e0b;
    color: white;
}

.squad-status-badge.rejected {
    background: #ef4444;
    color: white;
}

.squad-card-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Squad Document Editing Styles */
.squad-doc-container {
    max-width: 100%;
    margin: 0;
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 0;
    box-shadow: none;
    border: none;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

.squad-doc-content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

.squad-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.squad-header-row h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: #1a202c;
}

.squad-month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.squad-month-nav:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.squad-month-nav button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: inherit;
    line-height: 1;
    display: flex;
    align-items: center;
}

.squad-month-nav button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.squad-month-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.squad-month-display {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    min-width: 80px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.squad-header-underline {
    height: 3px;
    background: #4299e1;
    margin: 1rem 0 2rem 0;
    border-radius: 2px;
}

.squad-section-container {
    margin-bottom: 2rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
}

.squad-section-container:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.squad-section-container.expanded {
    border-color: #4299e1;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.squad-section-container.auto-expanded {
    border-color: #10b981;
    background: #f0fff4;
}

.squad-section-container.auto-expanded .squad-tldr-summary {
    background: #d1fae5;
    border-color: #10b981;
}

.squad-sections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.squad-tldr-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 0;
    font-style: italic;
    color: #0369a1;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.squad-tldr-summary:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.squad-tldr-label {
    font-weight: 600;
    font-style: normal;
    margin-bottom: 0.5rem;
    display: block;
}

.squad-expand-indicator {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-weight: 500;
}

.squad-section-details {
    padding: 2rem;
    border-top: 1px solid #e5e7eb;
}

.squad-adr-container {
    margin-bottom: 2rem;
}

.squad-adr-entry {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.squad-adr-entry:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.squad-adr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.squad-adr-title-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.squad-adr-title-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Toast UI Editor customization */
.toastui-editor-toolbar {
    display: none !important;
}

.toastui-editor-toolbar-divider {
    display: none !important;
}

.toastui-editor-defaultUI {
    border-top: 1px solid #e5e7eb !important;
}

.toastui-editor-defaultUI-toolbar {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Simplified word count styling */
.word-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-weight: 500;
    text-align: right;
    transition: color 0.2s ease;
}

.word-count.exceeded {
    color: #dc2626;
    font-weight: 600;
}

.word-count.warning {
    color: #f59e0b;
    font-weight: 600;
}

/* Editor border styling for word limits */
.toastui-editor-defaultUI.limit-exceeded {
    border-color: #dc2626 !important;
    border-width: 2px !important;
}

/* Button styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.5rem 0.5rem 0.5rem 0;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Squad submit section */
.squad-submit-section {
    margin-top: 3rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.squad-submit-btn {
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.squad-submit-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

.squad-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.squad-submit-btn.submitting {
    background: #6366f1;
    position: relative;
    overflow: hidden;
}

.squad-submit-btn.submitting::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.squad-submit-btn.submitted {
    background: #10b981;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.squad-submit-btn.submit-disabled {
    background: #f87171;
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}

.squad-submit-btn.submit-disabled:hover {
    background: #f87171;
    transform: none;
    box-shadow: none;
}

/* Submit loading overlay */
.submit-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.submit-loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
}

.submit-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.submit-loading-content h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.submit-loading-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Submit warning styles */
.submit-warning {
    margin: 1rem 0;
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

.submit-warning-content {
    color: #991b1b;
}

.submit-warning-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.submit-warning-content p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.submit-warning-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.submit-warning-content li {
    margin: 0.25rem 0;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Demo animation for summary generation */
.generating {
    opacity: 0.6;
    position: relative;
}

.generating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(66, 153, 225, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive design for squad documents */
@media (max-width: 768px) {
    .squad-doc-container {
        padding: 1rem;
    }
    
    .squad-doc-content-wrapper {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .squad-header-row {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .squad-sections-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Fix for Toast UI Editor overflow on mobile */
    .toastui-editor-defaultUI {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .toastui-editor-defaultUI .toastui-editor-main {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .toastui-editor-defaultUI .toastui-editor-main .toastui-editor-md-splitter {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .toastui-editor-defaultUI .toastui-editor-main .toastui-editor-md-splitter .toastui-editor-md-vertical-style {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .toastui-editor-defaultUI .toastui-editor-main .toastui-editor-md-splitter .toastui-editor-md-vertical-style .toastui-editor-md-preview {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    .toastui-editor-defaultUI .toastui-editor-main .toastui-editor-md-splitter .toastui-editor-md-vertical-style .toastui-editor-md-vertical-style {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure squad section containers don't overflow */
    .squad-section-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .squad-section-details {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .squad-adr-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .squad-adr-entry {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Fix for ADR title input overflow */
    .squad-adr-title-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .squad-adr-header {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .squad-adr-header .btn {
        align-self: flex-end !important;
        margin: 0 !important;
    }
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.auth-card h1 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 2rem;
}

.auth-card p {
    margin: 0 0 2rem 0;
    color: #718096;
    font-size: 1rem;
}

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.5rem;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.auth-button:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.auth-icon {
    font-size: 1.2rem;
}

.auth-error {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.auth-domains {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.auth-domains small {
    color: #a0aec0;
    font-size: 0.75rem;
}

/* User Info Styles */
.user-info {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.user-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
}

.user-details {
    text-align: center;
    margin-bottom: 1rem;
}

.user-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.8rem;
    color: #718096;
}

.sign-out-btn {
    width: 100%;
    padding: 0.5rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sign-out-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Role-based UI styles */
.role-indicator {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}

.role-editor {
    background: #10b981;
    color: white;
}

.role-opinion-giver {
    background: #f59e0b;
    color: white;
}

.role-decision-maker {
    background: #8b5cf6;
    color: white;
}

.role-viewer {
    background: #6b7280;
    color: white;
}

/* Opinion Giver Section */
.opinion-giver-section {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.opinion-giver-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 1rem;
}

.opinion-giver-question {
    font-size: 1rem;
    color: #92400e;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fffbeb;
    border-radius: 8px;
}

.opinion-giver-editor-container {
    margin-bottom: 1.5rem;
}

.opinion-giver-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.opinion-status {
    margin-top: 1rem;
    padding: 1rem;
    background: #d1fae5;
    border: 1px solid #10b981;
    border-radius: 8px;
}

.opinion-status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #10b981;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Decision Maker Section */
.decision-maker-section {
    background: #f3f4f6;
    border: 2px solid #8b5cf6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.decision-maker-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #553c9a;
    margin-bottom: 1.5rem;
}

.opinion-responses {
    margin-bottom: 2rem;
}

.opinion-response {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.opinion-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.opinion-response-author {
    font-weight: 600;
    color: #374151;
}

.opinion-response-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.opinion-response-status.answered {
    background: #d1fae5;
    color: #065f46;
}

.opinion-response-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.opinion-response-question {
    font-style: italic;
    color: #6b7280;
    margin-bottom: 1rem;
}

.opinion-response-answer {
    color: #374151;
    line-height: 1.5;
}

.opinion-response-pending {
    color: #9ca3af;
    font-style: italic;
}

.no-opinions {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Decision Options */
.decision-options {
    margin-bottom: 2rem;
}

.decision-cards-container {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.decision-card {
    flex: 1;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.decision-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.decision-card.selected {
    border-width: 3px;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.decision-card[data-decision="approved"] {
    border-color: #10b981;
    background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}

.decision-card[data-decision="approved"].selected {
    border-color: #059669;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.decision-card[data-decision="approved-conditions"] {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.decision-card[data-decision="approved-conditions"].selected {
    border-color: #d97706;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.decision-card[data-decision="rejected"] {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.decision-card[data-decision="rejected"].selected {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.decision-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.decision-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.decision-card-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Opinion Selection Interface */
.opinion-responses {
    margin-bottom: 2rem;
}

.opinion-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 2rem 0 1rem 0;
    padding: 0;
    border: none;
    background: none;
}

.opinion-question:first-child {
    margin-top: 0;
}

.selectable-statement {
    cursor: pointer;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    background: white;
    color: #4b5563;
    line-height: 1.5;
}

.selectable-statement:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}

.selectable-statement.selected {
    background: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
    font-weight: 500;
}

.selectable-statement.selected::before {
    content: "✓ ";
    color: #10b981;
    font-weight: bold;
}

/* Opinion attribution styling */
.opinion-attribution {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 0.25rem;
    text-align: right;
}

.selectable-opinion {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selectable-opinion:last-child {
    border-bottom: none;
}

.selectable-opinion:hover {
    background: #f8fafc;
}

.selectable-opinion.selected {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.opinion-checkbox {
    margin-top: 0.25rem;
    transform: scale(1.2);
    cursor: pointer;
}

.opinion-text {
    flex: 1;
    line-height: 1.5;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.additional-thoughts {
    margin-bottom: 1.5rem;
}

.additional-thoughts label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.rationale-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rationale-actions .btn {
    flex: 1;
}

.decision-rationale {
    margin-bottom: 2rem;
}

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

/* Published Decision Section */
.published-decision {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-left: 4px solid #4299e1;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.published-decision-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.published-decision-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.decision-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.decision-badge.approve {
    background: #d1fae5;
    color: #065f46;
}

.decision-badge.approve-with-conditions {
    background: #fef3c7;
    color: #92400e;
}

.decision-badge.reject {
    background: #fee2e2;
    color: #991b1b;
}

.decision-date {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

.published-decision-rationale {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.published-decision-footer {
    text-align: right;
    color: #718096;
    font-size: 0.875rem;
}

/* Responsive decision cards */
@media (max-width: 768px) {
    .decision-cards-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .decision-card {
        min-height: 80px;
        padding: 1rem;
    }
    
    .rationale-actions {
        flex-direction: column;
    }
}

/* Info Icon Tooltips */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    color: #6b7280;
    cursor: help;
    font-size: 14px;
    transition: color 0.2s ease;
    position: relative;
}

.info-icon:hover {
    color: #4299e1;
}