/* Reset and Base Styles */

.disclaimer-footer {
    display: none !important;
}


/* Modern RS Summary cards */
.rank-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    width: 100%;
    margin-top: 12px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 220ms ease, transform 220ms ease;
}

.rank-summary-grid.fade-hide {
    opacity: 0;
    transform: translateY(-4px);
}

.rank-summary-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    text-align: left;
    position: relative;
}

.rank-summary-card::after {
    content: "→ View details";
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: #999;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.rank-summary-card:hover, .rank-summary-card:focus-visible {
    transform: translateY(-2px);
    border-color: #c2185b;
    box-shadow: 0 8px 18px rgba(194,24,91,0.18);
    outline: none;
}

.rank-summary-card:hover::after {
    opacity: 1;
}

.rank-summary-card:focus-visible {
    outline: 3px solid #c2185b;
    outline-offset: 2px;
}

.grid-detail-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 999;
}
.grid-detail-backdrop.active {
    opacity: 1;
    pointer-events: all;
}
.grid-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80vw;
    max-width: 100vw;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 240ms ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.grid-detail-panel.active {
    transform: translateX(0);
}
.grid-detail-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}
.grid-detail-panel .panel-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.grid-detail-panel .panel-marine {
    font-weight: 600;
    font-size: 16px;
}
.grid-detail-panel .panel-rank {
    color: #6b7280;
    font-weight: 500;
    margin-left: 6px;
}
.grid-detail-panel .panel-meta {
    display: flex;
    gap: 10px;
    color: #6b7280;
    font-size: 12px;
}
.grid-detail-panel .panel-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
}
.grid-detail-panel .panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.grid-detail-panel .panel-delete {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b6b, #e53935);
    color: #fff;
    box-shadow: 0 2px 8px rgba(229,57,53,0.35);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.grid-detail-panel .panel-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(229,57,53,0.35);
}
.grid-detail-panel .panel-delete:focus-visible {
    outline: 3px solid rgba(229,57,53,0.5);
    outline-offset: 2px;
}
.grid-detail-panel .panel-body {
    padding: 12px 16px 20px;
    overflow-y: auto;
}
.eval-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 768px) {
    .eval-details-grid {
        grid-template-columns: 1fr;
    }
}
.grade-item,
.justification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.grade-item .trait-name {
    font-weight: 600;
    color: #111827;
    flex: 1;
}
.grade-item .sep {
    color: #9aa7b8;
}
.grade-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-weight: 700;
}
.justification-item p {
    margin: 0;
    color: #374151;
    font-size: 13px;
    line-height: 1.45;
    flex: 1;
}
.justification-item .trait-name {
    font-weight: 600;
    color: #111827;
}
.justification-item .sep {
    color: #9aa7b8;
}
.rank-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-weight: 600;
    border-radius: 999px;
    background: #f5f5f7;
    color: #111827;
}

.metric-group { display: flex; flex-direction: column; gap: 8px; }
.metric { display: flex; align-items: baseline; gap: 6px; }
.metric-label { color: #6b7280; font-size: 12px; }
.metric-value { font-size: 18px; font-weight: 700; color: #111827; }

.metric-bar {
    height: 8px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}
.metric-bar .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c2185b, #ff6ea8);
    border-radius: 999px;
    width: 0%;
    transition: width 240ms ease;
}

.metric-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #f3f4f6;
    color: #374151;
}

/* Summary toolbar */
.summary-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.summary-title { font-weight: 700; color: #111827; }
.toolbar-spacer { flex: 1; }
.sort-label { color: #6b7280; font-size: 12px; }
.sort-btn.active {
    background: #c2185b;
    color: #fff;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
  color: #333;
}

/* Skeleton loader styles */
.skeleton {
    position: relative;
    background: #e5e7eb;
    overflow: hidden;
    border-radius: 6px;
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0; left: -40%;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.6), rgba(255,255,255,0));
    animation: shimmer 1.2s infinite;
}
.skeleton-text { height: 14px; }
.skeleton-block { height: 48px; }
@keyframes shimmer { 100% { left: 100%; } }

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px 10px 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.98);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Header branding row */
.header-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.header-logo {
    max-height: 56px;
    max-width: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    content-visibility: auto;
    flex-shrink: 0;
}

.header-titles {
    text-align: left;
}

.header h1 {
    color: #1e3c72;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 4px 0 0 0;
    font-weight: 400;
}

/* Header info row */
.header-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.header-credit {
    color: #1e3c72;
    font-size: 0.8125rem;
    font-weight: 600;
}

.header-divider {
    color: #d1d5db;
    font-size: 0.75rem;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2563eb;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.link-icon {
    font-size: 0.75rem;
}

/* Header nav row - hidden by default */
.header-nav {
    display: none;
    padding-top: 12px;
}

/* Progress section - hidden by default, shown in evaluation mode */
.progress-section {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 12px;
    border-radius: 6px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #1e3c72;
    gap: 12px;
}

#progressText {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auto-save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #1e3c72;
    opacity: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.auto-save-indicator .icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #cbd5e1; /* slate-300 */
    border-top-color: #2563eb; /* blue-600 */
    display: none;
}
.auto-save-indicator.saving .icon {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}
.auto-save-indicator .text { color: inherit; }
.auto-save-indicator.saved { color: #4CAF50; }
.auto-save-indicator.unsaved { color: #d97706; }
.auto-save-indicator.error { color: #dc2626; }
.auto-save-indicator .retry-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    display: none;
}
.auto-save-indicator.error .retry-btn { display: inline; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Auth login route: keep header visible */
.auth-login .header { display: block; }
.auth-login #dataWarning { display: none !important; }

/* Home Mode Selection: keep header visible */
.home-mode .header { display: block; }

/* ---------------------------------------------
   Feedback Widget Styles (light + dark-friendly)
---------------------------------------------- */
.feedback-floating-btn {
    position: fixed;
    left: 0;
    bottom: 20px;
    transform: none;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}
.feedback-floating-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}
.feedback-floating-btn:active {
    transform: translateY(0);
}
.feedback-floating-btn:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.feedback-modal-open {
    overflow: hidden;
}
.feedback-modal-wrapper {
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.feedback-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}
.feedback-modal {
    position: absolute;
    left: 50%;
    top: 12%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 560px;
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
    border-radius: 10px;
    padding: 14px 16px;
}
@media (prefers-color-scheme: dark) {
    .feedback-modal {
        background: #111827;
        color: #f9fafb;
        border-color: #374151;
        box-shadow: 0 12px 24px rgba(0,0,0,0.6);
    }
}
.feedback-title {
    margin: 0 0 8px 0;
    font-size: 18px;
}
.feedback-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
}
.feedback-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}
.feedback-row label { font-weight: 600; }
.feedback-row input,
.feedback-row select,
.feedback-row textarea {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
}
@media (prefers-color-scheme: dark) {
    .feedback-row input,
    .feedback-row select,
    .feedback-row textarea {
        background: #1f2937;
        color: #f3f4f6;
        border-color: #374151;
    }
}
.feedback-help { color: #b45309; font-size: 12px; }
.feedback-actions { display: flex; justify-content: flex-end; gap: 8px; }
.feedback-submit { background: #2563eb; color: #fff; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.feedback-cancel { background: #e5e7eb; color: #111827; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.feedback-status { margin-top: 8px; font-size: 13px; }

/* Warning Banner */
.warning-banner {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Adverse-report designation. Distinct from .warning-banner because the
   designation MUST print (warning-banner is hidden in @media print). */
.adverse-notice {
    background: #fdecea;
    border: 2px solid #c62828;
    color: #7f1d1d;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.review-trait-item--adverse {
    border-left: 4px solid #c62828;
}

/* Card Styles */
.setup-card, 
.evaluation-card, 
.review-card,
.summary-card,
.directed-comments-card,
.section-i-generation-card,
.profile-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    display: none;
}

.setup-card.active, 
.evaluation-card.active, 
.review-card.active,
.summary-card.active,
.directed-comments-card.active,
.section-i-generation-card.active,
.profile-card.active {
    display: block; /* ensure active cards are visible */
    margin-left: auto; /* center cards horizontally */
    margin-right: auto; /* center cards horizontally */
}

.profile-card.active {
    display: block;
    animation: slideIn 0.5s ease-out;
}

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

/* Decorative Typewriter Animation (Uiverse.io by Nawsome) */
.typewriter-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

.typewriter {
  --blue: #5C86FF;
  --blue-dark: #275EFE;
  --key: #fff;
  --paper: #EEF0FD;
  --text: #D3D4EC;
  --tool: #FBC56C;
  --duration: 3s;
  position: relative;
  -webkit-animation: bounce05 var(--duration) linear infinite;
  animation: bounce05 var(--duration) linear infinite;
}

.typewriter .slide {
  width: 92px;
  height: 20px;
  border-radius: 3px;
  margin-left: 14px;
  transform: translateX(14px);
  background: linear-gradient(var(--blue), var(--blue-dark));
  -webkit-animation: slide05 var(--duration) ease infinite;
  animation: slide05 var(--duration) ease infinite;
}

.typewriter .slide:before, .typewriter .slide:after,
.typewriter .slide i:before {
  content: "";
  position: absolute;
  background: var(--tool);
}

.typewriter .slide:before {
  width: 2px;
  height: 8px;
  top: 6px;
  left: 100%;
}

.typewriter .slide:after {
  left: 94px;
  top: 3px;
  height: 14px;
  width: 6px;
  border-radius: 3px;
}

.typewriter .slide i {
  display: block;
  position: absolute;
  right: 100%;
  width: 6px;
  height: 4px;
  top: 4px;
  background: var(--tool);
}

.typewriter .slide i:before {
  right: 100%;
  top: -2px;
  width: 4px;
  border-radius: 2px;
  height: 14px;
}

.typewriter .paper {
  position: absolute;
  left: 24px;
  top: -26px;
  width: 40px;
  height: 46px;
  border-radius: 5px;
  background: var(--paper);
  transform: translateY(46px);
  -webkit-animation: paper05 var(--duration) linear infinite;
  animation: paper05 var(--duration) linear infinite;
}

.typewriter .paper:before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 7px;
  border-radius: 2px;
  height: 4px;
  transform: scaleY(0.8);
  background: var(--text);
  box-shadow: 0 12px 0 var(--text), 0 24px 0 var(--text), 0 36px 0 var(--text);
}

.typewriter .keyboard {
  width: 120px;
  height: 56px;
  margin-top: -10px;
  z-index: 1;
  position: relative;
}

.typewriter .keyboard:before, .typewriter .keyboard:after {
  content: "";
  position: absolute;
}

.typewriter .keyboard:before {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  transform: perspective(10px) rotateX(2deg);
  transform-origin: 50% 100%;
}

.typewriter .keyboard:after {
  left: 2px;
  top: 25px;
  width: 11px;
  height: 4px;
  border-radius: 2px;
  box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  -webkit-animation: keyboard05 var(--duration) linear infinite;
  animation: keyboard05 var(--duration) linear infinite;
}

@keyframes bounce05 {
  85%, 92%, 100% {
    transform: translateY(0);
  }

  89% {
    transform: translateY(-4px);
  }

  95% {
    transform: translateY(2px);
  }
}

@keyframes slide05 {
  5% {
    transform: translateX(14px);
  }

  15%, 30% {
    transform: translateX(6px);
  }

  40%, 55% {
    transform: translateX(0);
  }

  65%, 70% {
    transform: translateX(-4px);
  }

  80%, 89% {
    transform: translateX(-12px);
  }

  100% {
    transform: translateX(14px);
  }
}

@keyframes paper05 {
  5% {
    transform: translateY(46px);
  }

  20%, 30% {
    transform: translateY(34px);
  }

  40%, 55% {
    transform: translateY(22px);
  }

  65%, 70% {
    transform: translateY(10px);
  }

  80%, 85% {
    transform: translateY(0);
  }

  92%, 100% {
    transform: translateY(46px);
  }
}

@keyframes keyboard05 {
  5%, 12%, 21%, 30%, 39%, 48%, 57%, 66%, 75%, 84% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  9% {
    box-shadow: 15px 2px 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  18% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 2px 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  27% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 12px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  36% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 12px 0 var(--key), 60px 12px 0 var(--key), 68px 12px 0 var(--key), 83px 10px 0 var(--key);
  }

  45% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 2px 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  54% {
    box-shadow: 15px 0 0 var(--key), 30px 2px 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  63% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 12px 0 var(--key);
  }

  72% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 2px 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 10px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }

  81% {
    box-shadow: 15px 0 0 var(--key), 30px 0 0 var(--key), 45px 0 0 var(--key), 60px 0 0 var(--key), 75px 0 0 var(--key), 90px 0 0 var(--key), 22px 10px 0 var(--key), 37px 12px 0 var(--key), 52px 10px 0 var(--key), 60px 10px 0 var(--key), 68px 10px 0 var(--key), 83px 10px 0 var(--key);
  }
}

/* Progressive Disclosure Styles */
.section-context {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #2a5298;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 24px;
    color: #1e3c72;
    font-weight: 600;
}

.section-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-progress-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.section-progress-bar {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    overflow: hidden;
}

.section-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.section-description {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
}

.section-importance {
    font-size: 13px;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

.trait-context {
    margin-bottom: 20px;
}

.trait-header {
    text-align: center;
    margin-bottom: 20px;
}

.trait-subtitle {
    font-size: 22px;
    color: #2a5298;
    margin-bottom: 10px;
    font-weight: 500;
}

.trait-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

.grade-context {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.current-grade-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.grade-level {
    font-size: 16px;
    color: #1976d2;
}

.grade-meaning {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.evaluation-guidance {
    background: #fff3e0;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #ff9800;
}

.guidance-question {
    font-size: 16px;
    color: #333;
    text-align: center;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.btn {
    padding: 20px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.button-label {
    font-size: 16px;
    font-weight: 600;
}

.button-description {
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.8;
}

.navigation-helper {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.overall-progress {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.remaining-sections {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.validation-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid #ff9800;
    display: none;
}

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

.validation-success {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.validation-icon {
    font-size: 24px;
    color: #4CAF50;
    font-weight: bold;
}

.validation-summary {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.validation-summary h4 {
    color: #1e3c72;
    margin-bottom: 10px;
}

.validation-counts {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.error-count {
    background: #ffebee;
    color: #d32f2f;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ffcdd2;
}

.warning-count {
    background: #fff3e0;
    color: #f57c00;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ffcc02;
}

.info-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #bbdefb;
}

.validation-group {
    margin: 15px 0;
}

.validation-group h5 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.validation-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 6px;
    border-left: 4px solid #ddd;
}

.validation-item.error {
    border-left-color: #f44336;
    background: #ffebee;
}

.validation-item.warning {
    border-left-color: #ff9800;
    background: #fff8e1;
}

.validation-item.info {
    border-left-color: #2196F3;
    background: #e3f2fd;
}

.validation-message {
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.validation-item.error .validation-message {
    color: #d32f2f;
}

.validation-item.warning .validation-message {
    color: #f57c00;
}

.validation-item.info .validation-message {
    color: #1976d2;
}

.validation-recommendation {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    font-style: italic;
}

/* Setup and Form Styles */
.setup-title {
    font-size: 24px;
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e3c72;
}

/* Required field indicator (standardized) */
.form-label .required-indicator {
  margin-left: 6px;
  color: #c2185b;
  font-weight: 700;
}
.form-group.required .required-indicator { display: inline; }
.form-group .required-indicator { display: none; }

.breadcrumbs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #1e3c72;
}
.breadcrumbs .crumb {
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}
.breadcrumbs .sep { color: #94a3b8; }
.breadcrumbs .crumb.active { color: #111827; cursor: default; text-decoration: none; font-weight: 600; }

.form-input, .setup-select {
    width: 100%;
    padding: 12px;
    font-size: 16px; /* Keep 16px to prevent iOS zoom on focus */
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    margin: 15px 0;
    line-height: 1.5;
}

.section-i-textarea:focus {
    outline: none;
    border-color: #2a5298;
}

.generation-options {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.generation-btn {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.generation-btn:hover {
    background: #e0e0e0;
}

.generation-btn.primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-color: #4CAF50;
}

.generation-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.word-count-display {
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.word-count-display.good {
    color: #4CAF50;
}

.word-count-display.warning {
    color: #ff9800;
}

/* Summary Styles */
.fitrep-average {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
    font-size: 24px;
    font-weight: bold;
}

.fitrep-average-note {
    text-align: center;
    margin: -8px 0 20px;
    font-size: 13px;
    color: #666;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.summary-trait {
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 5px;
}

.summary-grade {
    font-size: 20px;
    font-weight: bold;
    color: #2a5298;
    margin-bottom: 5px;
}

.summary-justification {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    font-style: italic;
}

.export-section {
    margin-top: 30px;
    text-align: center;
}

.button-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Form Input Styles */
.form-input:focus, .setup-select:focus {
    outline: none;
    border-color: #2a5298;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Trait Evaluation Styles */
.trait-header {
    margin-bottom: 25px;
    text-align: center;
}

.trait-title {
    font-size: 24px;
    color: #1e3c72;
    margin-bottom: 8px;
    font-weight: 600;
}

.trait-subtitle {
    font-size: 18px;
    color: #2a5298;
    margin-bottom: 15px;
    font-weight: 500;
}

.trait-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    font-style: italic;
}

/* Grade Display */
.grade-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    text-align: center;
}

.grade-display.adverse {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.grade-display.below-standards {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.grade-display.acceptable {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.grade-display.excellent {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.grade-description {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* Button Styles */
.btn-does-not-meet {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-meets {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-surpasses {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: white;
}

.btn-third {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: rgb(0, 0, 0);
}

.btn-export {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    padding: 12px 25px;
    margin: 0 5px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Review Screen Styles */
.review-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #2a5298;
}

.review-summary h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 20px;
}

.review-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.review-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.review-section-title {
    color: #1e3c72;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.review-traits {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-trait-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.review-trait-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.review-trait-name {
    font-weight: 600;
    color: #1e3c72;
    font-size: 16px;
}

.btn-edit {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.review-trait-criteria {
    margin-bottom: 15px;
}

.criteria-meets {
    background: #e8f5e8;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #4CAF50;
}

.criteria-does-not-meet {
    background: #ffebee;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #f44336;
}

.criteria-surpasses {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #2196F3;
}

.criteria-meets strong {
    color: #2e7d32;
}

.criteria-does-not-meet strong {
    color: #d32f2f;
}

.criteria-surpasses strong {
    color: #1976d2;
}

.criteria-unavailable {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
    color: #666;
    font-style: italic;
}

.review-trait-justification {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #2a5298;
}

.review-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Mobile optimizations for review grid */
@media (max-width: 600px) {
    .review-grid {
        gap: 16px;
    }

    .review-section {
        padding: 14px;
        border-radius: 10px;
    }

    .review-section-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .review-traits {
        gap: 12px;
    }

    .review-trait-item {
        padding: 12px;
        border-radius: 8px;
    }

    .review-trait-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .review-trait-name {
        font-size: 14px;
        width: 100%;
    }

    .btn-edit {
        width: 100%;
        padding: 10px 16px;
        font-size: 13px;
        justify-content: center;
    }

    .review-trait-criteria {
        margin-bottom: 12px;
    }

    .criteria-meets,
    .criteria-does-not-meet,
    .criteria-surpasses,
    .criteria-unavailable {
        padding: 8px 10px;
        font-size: 13px;
    }

    .review-trait-justification {
        font-size: 13px;
        padding: 10px;
    }

    .review-actions {
        margin-top: 20px;
        padding-top: 16px;
    }

    .review-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Re-evaluation Modal Styles */
.reevaluate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.reevaluate-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.reevaluate-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.reevaluate-header {
    text-align: center;
    margin-bottom: 25px;
}

.reevaluate-header h3 {
    color: #1e3c72;
    font-size: 24px;
    margin-bottom: 10px;
}

.reevaluate-header p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    font-style: italic;
}

.reevaluate-body {
    margin-bottom: 20px;
}

.current-evaluation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #2a5298;
}

.current-evaluation h4 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 16px;
}

.current-eval-display {
    margin-bottom: 15px;
}

.current-eval-criteria {
    margin-bottom: 15px;
}

.current-eval-justification {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.reevaluate-options {
    text-align: center;
}

.reevaluate-options h4 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 18px;
}

.reevaluate-options p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.reevaluate-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal Styles */
.justification-modal, .help-modal, .reevaluate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.justification-modal.active, .help-modal.active, .reevaluate-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.help-modal.active {
    z-index: 1001;
    padding: 20px;
}

.justification-content, .help-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.help-content {
    max-width: 800px;
    width: 100%;
    position: relative;
    text-align: left;
}

/* Justification Tools */
.justification-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 12px 16px;
    min-height: 44px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.tool-btn:hover {
    background: #e0e0e0;
}

.tool-btn.active {
    background: #2196F3;
    color: white;
}

/* Textarea and Text Input Styles */
.textarea-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
}

.word-count {
    color: #2a5298;
}

.word-count.warning {
    color: #ff9800;
}

.word-count.error {
    color: #f44336;
}

.justification-header {
    margin-bottom: 20px;
    text-align: center;
}

.justification-title {
    color: #1e3c72;
    font-size: 20px;
    margin-bottom: 15px;
}

.justification-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 20px;
}

.justification-textarea:focus {
    outline: none;
    border-color: #2a5298;
}

.justification-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-save {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-cancel {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: white;
}

/* Help Button and Modal */
.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.help-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.help-close:hover {
    background: #f0f0f0;
}

/* Screen reader only utility */
.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;
}

/* High-visibility focus outlines */
.btn:focus-visible,
.help-button:focus-visible,
.sub-button:focus-visible,
.tool-btn:focus-visible,
.help-close:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* Directed Comments Styles */
.directed-comments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.directed-comment-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.directed-comment-item:hover {
    border-color: #2a5298;
    transform: translateY(-2px);
}

.directed-comment-item.selected {
    border-color: #4CAF50;
    background: #e8f5e8;
}

.comment-title {
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-preview {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    font-style: italic;
}

.selected-comments-section {
    margin-top: 30px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 12px;
    border: 1px solid #bbdefb;
    display: none;
}

.selected-comments-section.active {
    display: block;
}

.comment-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #2a5298;
}

.comment-form-title {
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.placeholder-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.placeholder-input:focus {
    outline: none;
    border-color: #2a5298;
}

.comment-preview-text {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    border-left: 3px solid #4CAF50;
}

/* Section I Generation Styles */
.analysis-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid #2a5298;
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.stat-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2a5298;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-tier-display {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin: 10px 0;
}

.tier-top {
    background: #e8f5e8;
    color: #2e7d32;
}

.tier-middle {
    background: #e3f2fd;
    color: #1976d2;
}

.tier-developing {
    background: #fff3e0;
    color: #f57c00;
}

/* Grade Groups Panel Styles */
.grade-groups-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid #4CAF50;
}

.grade-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.grade-group {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.grade-group:hover {
    transform: translateY(-2px);
}

.grade-group-header {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.grade-group-title {
    font-weight: 600;
    font-size: 16px;
    display: block;
}

.grade-group-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
    display: block;
}

.grade-group-content {
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.grade-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.grade-item:last-child {
    border-bottom: none;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.grade-badge.grade-a {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.grade-badge.grade-b {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.grade-badge.grade-c {
    background: linear-gradient(135deg, #ffeb3b, #fbc02d);
    color: #333;
}

.grade-badge.grade-d {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.grade-badge.grade-e {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.grade-badge.grade-f {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.grade-badge.grade-g {
    background: linear-gradient(135deg, #ff5722, #d84315);
}

.trait-name {
    font-size: 13px;
    color: #333;
    line-height: 1.3;
    flex-grow: 1;
}

.no-grades-message {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.grade-group.no-grades .grade-group-header {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
}

.section-i-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin: 15px 0;
    line-height: 1.5;
}

/* Mode Selection Card */
#modeSelectionCard {
    max-width: 700px;
    margin: 24px auto;
    padding: 30px;
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.mode-option-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 200px;
}

.mode-option-btn:hover {
    transform: translateY(-4px);
    border-color: #2a5298;
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.mode-option-btn:focus-visible {
    outline: 3px solid #2a5298;
    outline-offset: 2px;
}

.mode-icon {
    font-size: 48px;
    line-height: 1;
}

.mode-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e3c72;
}

.mode-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* RS Login sizing refinements */
#profileLoginCard {
    max-width: 640px;
    margin: 24px auto;
    padding: 20px;
}

/* Center login card content vertically on mobile */
@media (max-width: 480px) {
    #profileLoginCard {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100vh - 200px);
        margin: 0 auto;
        padding: 20px 16px;
    }

    #profileLoginCard .profile-title {
        text-align: center;
    }

    #profileLoginCard .profile-description {
        text-align: center;
    }
}

#profileLoginCard .profile-title {
    font-size: 22px;
    margin-bottom: 8px;
}

#profileLoginCard .profile-description {
    font-size: 14px;
    margin-bottom: 16px;
    color: #555;
}

#profileLoginCard .form-group {
    margin-bottom: 12px;
}

#profileLoginCard .form-input {
    font-size: 14px;
    padding: 10px 12px;
}

#profileLoginCard .profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

#profileLoginCard .profile-actions .btn {
    padding: 8px 12px;
    font-size: 14px;
}

/* Hide legacy rank button bar; use summary Grade buttons instead */
#rankFilterBar {
    display: none !important;
}
/* Optional: tighten summary rank buttons for table layout */
.summary-table .rank-filter-btn {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    .setup-card, 
    .evaluation-card, 
    .review-card,
    .summary-card,
    .directed-comments-card,
    .section-i-generation-card,
    .profile-card {
    
    #profileLoginCard {
        max-width: 92%;
        padding: 16px;
        margin: 16px auto;
    }
    #profileLoginCard .profile-title {
        font-size: 20px;
    }
    #profileLoginCard .profile-actions .btn {
        width: 100%;
    }
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .trait-subtitle {
        font-size: 18px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 18px 25px;
        min-width: auto;
    }
    
    .button-label {
        font-size: 15px;
    }
    
    .button-description {
        font-size: 11px;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .justification-content, .help-content {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
    
    .reevaluate-content {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
    
    .help-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
    .feedback-floating-btn {
        left: 0;
        right: auto;
        bottom: 15px;
        transform: none;
    }
    
    .directed-comments-grid {
        grid-template-columns: 1fr;
    }
    
    .grade-groups-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .generation-options {
        flex-direction: column;
        align-items: center;
    }
    
    .generation-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .review-trait-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .review-trait-name {
        font-size: 14px;
    }
    
    .current-eval-display {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .reevaluate-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .reevaluate-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .validation-counts {
        justify-content: center;
    }
    
    .button-row {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-export {
        width: 100%;
        max-width: 200px;
        margin: 5px 0;
    }
    
    .profile-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .profile-stats {
        width: 100%;
        justify-content: space-around;
        margin-top: 15px;
    }

    .evaluation-filters {
        grid-template-columns: 1fr;
    }

    .eval-details-grid {
        grid-template-columns: 1fr;
    }

    .eval-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* Tooltip System */
.info-icon {
    background: none;
    border: none;
    cursor: help;
    font-size: 18px;
    color: #2196F3;
    padding: 8px;
    margin-left: 4px;
    vertical-align: middle;
    transition: transform 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-icon:hover {
    transform: scale(1.2);
}

.tooltip-content {
    display: none;
    position: fixed;
    background: #1e3c72;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    z-index: 100000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

/* Responsive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.table-responsive table {
  width: 100%;
  border-collapse: collapse;
}
.profile-grid thead th,
.table.sticky thead th {
  position: sticky;
  top: 0;
  background: #0f172a; /* dark header for contrast */
  color: #fff;
  z-index: 2;
}
.profile-grid th, .profile-grid td,
.table th, .table td {
  padding: 14px 12px;
}

/* Touch target and feedback */
.btn,
.help-button,
.info-icon {
  min-height: 48px;
  min-width: 48px;
}
.btn {
  padding: 12px 16px;
  transition: transform 120ms ease, background-color 120ms ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn:focus-visible,
.help-button:focus-visible,
.info-icon:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* Mobile-first breakpoints */
/* Small phones */
@media (max-width: 480px) {
  .container { padding: 12px 12px 6px 12px; }
  .form-group { margin-bottom: 14px; }
  .setup-select, .form-input { width: 100%; }
  .evaluation-filters { grid-template-columns: 1fr; gap: 12px; }
  .profile-grid-wrapper { padding: 8px; }
}

/* ===== Mobile Navigation ===== */


/* Phones/portrait tablets - RS Dashboard improvements */
@media (max-width: 640px) {
  .eval-details-grid { grid-template-columns: 1fr; }
  .profile-header-section {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    text-align: center;
  }
  .profile-grid { font-size: 14px; }
  .profile-grid-wrapper { overflow-x: auto; }

  /* Profile info centering */
  .profile-info {
    text-align: center;
    width: 100%;
  }

  .profile-info h2 {
    font-size: 1.25rem;
    word-break: break-word;
  }

  /* Profile stats row */
  .profile-stats {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    width: 100%;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 10px;
  }

  /* Profile actions - side by side on mobile */
  .profile-actions-bar {
    flex-direction: row;
    width: 100%;
    gap: 8px;
  }

  .profile-actions-bar .btn {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
    justify-content: center;
  }

  .profile-actions-bar .manage-data-container {
    flex: 1;
    margin-left: 0;
  }

  .profile-actions-bar .manage-data-container .btn {
    width: 100%;
  }

  /* Profile name: show short name on mobile, hide full name */
  .profile-full-name {
    display: none;
  }
  .profile-short-name {
    display: inline;
  }

  /* Rank summary section */
  .rank-summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rank-summary-card {
    padding: 12px;
  }

  /* Section headers with full width */
  .profile-section-title,
  .filter-section-title,
  h3 {
    width: 100%;
    text-align: left;
    padding-left: 4px;
  }

  /* Manage data dropdown */
  .manage-data-dropdown {
    width: 100%;
  }

  .manage-data-dropdown .btn {
    width: 100%;
  }

  /* Sort buttons row */
  .sort-buttons,
  .filter-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sort-buttons .btn,
  .filter-buttons .btn {
    flex: 1 1 auto;
    min-width: 80px;
    font-size: 12px;
    padding: 8px 12px;
  }

  /* Edit button on profile card */
  .profile-actions-top-right {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .profile-actions-top-right .editBtn {
    padding: 8px;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .evaluation-filters { grid-template-columns: 1fr; }
  .setup-card { padding: 12px; }
}

/* Small laptops */
@media (max-width: 1024px) {
  .eval-meta { flex-direction: column; gap: 6px; }
}

/* Larger screens */
@media (min-width: 1280px) {
  .container { max-width: 1100px; margin: 0 auto; }
}

.tooltip-content::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1e3c72;
}

.tooltip-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.tooltip-content.tooltip-centered {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    max-width: min(90vw, 600px);
}

.storage-option {
    position: relative;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    border-left: 4px solid #2196F3;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-info {
    border-left-color: #2196F3;
}

.notification-success {
    border-left-color: #4CAF50;
}

.notification-warning {
    border-left-color: #ff9800;
}

.notification-error {
    border-left-color: #f44336;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-header strong {
    color: #1e3c72;
    font-size: 15px;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.notification-close:hover {
    background: #f0f0f0;
}

.notification-body {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2a5298;
}

.breadcrumb-nav .Btn {
    margin-left: auto;
}

.breadcrumb-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #2a5298;
    transition: all 0.2s ease;
}

.breadcrumb-btn:hover {
    background: #e3f2fd;
    transform: translateX(-2px);
}

.breadcrumb-btn:focus-visible {
    outline: 2px solid #2a5298;
    outline-offset: 2px;
}

.breadcrumb-icon {
    font-size: 16px;
    line-height: 1;
}

.breadcrumb-text {
    font-size: 14px;
}

.breadcrumb-separator {
    color: #999;
    font-size: 16px;
    margin: 0 4px;
}

.breadcrumb-current {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Breadcrumb social banner */
.breadcrumb-banner{
    flex:1;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:.5rem;
    padding:.35rem .75rem;
    margin:0;
    border-radius:999px;
    background:rgba(255,255,255,0.25);
    box-shadow:0 1px 3px rgba(0,0,0,0.08);
    color:#111827;
}
.breadcrumb-banner a{color:#1e3c72;font-weight:600;text-decoration:underline}
.breadcrumb-banner .banner-icon{font-size:14px;color:#2a5298}

/* Mobile breadcrumb nav */
@media (max-width: 640px) {
    .breadcrumb-nav {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }

    .breadcrumb-btn {
        flex-shrink: 0;
    }

    .breadcrumb-banner {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
        margin-top: 4px;
        font-size: 12px;
    }

    .breadcrumb-nav .Btn {
        margin-left: auto;
    }

    /* Logout button styling on mobile */
    .breadcrumb-nav .Btn .text {
        display: none;
    }
}

/* Even UI spacer under breadcrumb */
.breadcrumb-even-spacer{height:12px}

/* Profile System Styles */
.profile-title {
    font-size: 24px;
    color: #1e3c72;
    margin-bottom: 15px;
    text-align: center;
}

.profile-description {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

/* Profile name display - full name visible by default, short name hidden */
.profile-full-name {
    display: inline;
}
.profile-short-name {
    display: none;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(0,0,0,0.05);
    border-color: #999;
}

.theme-toggle .theme-icon {
    font-size: 16px;
    line-height: 1;
}

.theme-toggle .theme-label {
    font-weight: 500;
}

/* Profile Header */
.profile-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 25px;
}

.profile-actions-top-right {
    display: flex;
    align-items: flex-start;
}

.profile-info h2 {
    color: #1e3c72;
    margin-bottom: 5px;
}

.profile-info p {
    color: #666;
    font-size: 14px;
}

.profile-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #2a5298;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Profile Actions */
.profile-actions-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Evaluation Filters */
.evaluation-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* Name + 3 selects side-by-side */
    gap: 10px;
    margin-bottom: 20px;
}

/* Expand evaluations list and grid to full width of filters grid */
#evaluationFilters #evaluationsList,
#evaluationFilters #profileGridContainer {
    grid-column: 1 / -1;
    width: 100%;
}

.filter-input, .filter-select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    width: 100%; /* Stretch each control across the column */
}

/* Evaluation List Items */
.evaluations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.evaluation-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%; /* Ensure full width of container */
}

.evaluation-item:hover {
    border-color: #2a5298;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.eval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background: #f8f9fa;
    width: 100%; /* Stretch header full width */
}

/* RS Dashboard: make evaluations span the full container width */
#profileDashboardCard {
    width: 100%;
    margin: 0 auto; /* center the dashboard card */
}

#profileDashboardCard .evaluations-list {
    align-items: stretch; /* ensure flex items fill the list width */
    width: 100%;
}

#profileDashboardCard .evaluation-item,
#profileDashboardCard .eval-header,
#profileDashboardCard .eval-details {
    width: 100%; /* stretch header and details */
}

#profileDashboardCard .profile-grid-wrapper {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

#profileDashboardCard .profile-grid-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start; /* keep buttons left-aligned */
    gap: 10px;
}

#profileDashboardCard .profile-grid {
    width: 100%;
    table-layout: auto; /* let columns use available width */
}

#profileDashboardCard .profile-grid thead th,
#profileDashboardCard .profile-grid tbody td {
    width: auto;        /* allow columns to stretch evenly */
    white-space: normal; /* allow wrapping to use width */
}

.eval-summary {
    flex: 1;
}

.eval-marine-info {
    margin-bottom: 8px;
}

.marine-rank {
    background: #2a5298;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.marine-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e3c72;
}

.eval-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.eval-average {
    color: #4CAF50;
    font-weight: 600;
}

.eval-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.sync-status.synced {
    background: #e8f5e8;
    color: #2e7d32;
}

.sync-status.pending {
    background: #fff3e0;
    color: #f57c00;
}

.sync-status.failed {
    background: #ffebee;
    color: #d32f2f;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: transform 0.2s ease;
}

.icon-btn:hover {
    transform: scale(1.2);
}

.expand-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.evaluation-item.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Evaluation Details */
.eval-details {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    width: 100%; /* Stretch details full width */
}

/* Grid details: force left alignment inside the expanded row */
.profile-grid .grid-details-row td {
    text-align: left;
}

.eval-details-grid {
    display: grid;
    grid-template-columns: 1fr; /* Full-width column layout */
    gap: 20px;
    margin-bottom: 20px;
}

/* Expanded details should use one full-width column */
#profileDashboardCard .eval-details-grid {
    grid-template-columns: 1fr;
}

.detail-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h4 {
    color: #1e3c72;
    margin-bottom: 12px;
    font-size: 16px;
    text-align: left;
}

.traits-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trait-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.trait-grade {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
}

.trait-grade.grade-f, .trait-grade.grade-g {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.trait-grade.grade-d, .trait-grade.grade-e {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.trait-section {
    font-size: 11px;
    color: #999;
}

.comments-text {
    background: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.justifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.justification-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #2a5298;
}

.justification-item strong {
    color: #1e3c72;
    display: block;
    margin-bottom: 5px;
}

.justification-item p {
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    margin: 0;
}

.justifications-list,
.justification-item,
.justification-item p {
    text-align: left;
}

.eval-detail-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Save to Profile Modal */
.save-profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.save-profile-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.save-profile-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
}

.save-profile-content h3 {
    color: #1e3c72;
    text-align: center;
    margin-bottom: 15px;
}

.save-profile-content > p {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

.evaluation-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-item {
    margin-bottom: 8px;
}

.preview-item strong {
    color: #1e3c72;
    margin-right: 8px;
}

.storage-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.storage-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* Offline Indicator */
.offline-indicator {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background: #4CAF50;
}

.status-dot.offline {
    background: #ff9800;
}

/* RS Profile Grid */
.profile-grid-wrapper {
    margin-top: 10px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.profile-grid-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.profile-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.profile-grid thead th {
    position: sticky;
    top: 0;
    background: #1e3c72;
    color: #fff;
    padding: 6px;
    text-align: center;
    z-index: 1;
    vertical-align: middle; /* center header text vertically */
}

.profile-grid tbody td {
    border-top: 1px solid #eee;
    padding: 6px;
    text-align: center;
    color: #333;
    vertical-align: middle; /* center cell content vertically */
}

/* Keep simple styling for the first two columns without stickiness */
.profile-grid tbody td:nth-child(1) {
    font-weight: 600;
}

.profile-grid tbody td:nth-child(2) {
    text-align: left;
    font-weight: 500;
    color: #1e3c72;
}

.profile-grid tbody tr:hover {
    background: #f8f9fa;
}

.profile-grid .grade-cell {
    font-weight: 600;
    border-radius: 4px;
}

.profile-grid .avg-cell {
    font-weight: 700;
    color: #1e3c72;
}

/* RS Dashboard: make non-fullscreen Grid View a single-column card list */
.profile-grid-wrapper:not(.fullscreen) .profile-grid {
    display: table;            /* restore table layout */
    width: 100%;               /* span full container */
    table-layout: auto;        /* let columns distribute naturally */
}

.profile-grid-wrapper:not(.fullscreen) .profile-grid thead {
    display: table-header-group; /* show header */
}

.profile-grid-wrapper:not(.fullscreen) .profile-grid tbody {
    display: table-row-group;    /* table body semantics */
}

.profile-grid-wrapper:not(.fullscreen) .profile-grid tbody tr {
    display: table-row;          /* restore rows */
    background: transparent;     /* remove card styling */
    border: none;
    padding: 0;
    border-radius: 0;
}

.profile-grid-wrapper:not(.fullscreen) .profile-grid tbody td {
    display: table-cell;         /* restore cells */
    padding: 6px;                /* keep readable spacing */
    border-top: 1px solid #eee;  /* keep subtle row separators */
    white-space: nowrap;         /* prevent overly tall rows; wrap only if needed */
    width: auto;
}

.profile-grid-wrapper:not(.fullscreen) .profile-grid tbody td.avg-cell {
    font-weight: 700;
    color: #1e3c72;
}

.profile-grid th:last-child,
.profile-grid td.actions-cell {
    min-width: 90px;
    text-align: right;
}

.rv-badge {
    display: inline-block;
    min-width: 40px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 11px;
}

.rv-high { background: #e8f5e8; color: #2e7d32; }
.rv-mid  { background: #fff3e0; color: #f57c00; }
.rv-low  { background: #ffebee; color: #d32f2f; }

/* Profile Grid Fullscreen */
.profile-grid-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 16px;
    border: none;
    border-radius: 0;
    z-index: 2000;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.profile-grid-wrapper.fullscreen .profile-grid-actions {
    justify-content: space-between;
    gap: 10px;
}

.profile-grid-wrapper.fullscreen .profile-grid {
    width: 100%;
    /* thead th are already sticky; table will scroll within fullscreen wrapper */
}

@media (max-width: 768px) {
    .profile-grid { font-size: 11px; }
    .profile-grid thead th { padding: 4px; }
    .profile-grid tbody td { padding: 4px; }
}

/* Mobile Card Layout for Profile Grid - transforms table to cards on small screens */
@media (max-width: 600px) {
    .profile-grid-wrapper {
        padding: 8px;
        border: none;
        background: transparent;
    }

    .profile-grid-actions {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        margin-bottom: 12px;
    }

    .profile-grid-actions select,
    .profile-grid-actions button {
        flex: 1 1 auto;
        min-width: 120px;
    }

    #rankSummaryBar {
        width: 100%;
        justify-content: space-around !important;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
        margin-left: 0 !important;
    }

    /* Hide table header on mobile */
    .profile-grid thead {
        display: none;
    }

    /* Transform table to block layout */
    .profile-grid,
    .profile-grid tbody,
    .profile-grid tbody tr,
    .profile-grid tbody td {
        display: block;
        width: 100%;
    }

    /* Style each row as a card */
    .profile-grid tbody tr {
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        position: relative;
    }

    .profile-grid tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }

    /* Reset cell styles for card layout */
    .profile-grid tbody td {
        border: none;
        padding: 4px 0;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Add labels before each cell value */
    .profile-grid tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #1e3c72;
        flex-shrink: 0;
        margin-right: 12px;
    }

    /* Hide row number column */
    .profile-grid tbody td:nth-child(1) {
        display: none;
    }

    /* Marine name - make prominent */
    .profile-grid tbody td:nth-child(3) {
        font-size: 16px;
        font-weight: 700;
        color: #1e3c72;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
        margin-bottom: 8px;
    }

    /* Rank badge styling */
    .profile-grid tbody td:nth-child(2) {
        position: absolute;
        top: 12px;
        right: 12px;
        background: #1e3c72;
        color: #fff;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
    }

    .profile-grid tbody td:nth-child(2)::before {
        display: none;
    }

    /* Hide individual trait columns on mobile (columns 6-18) - show only summary */
    .profile-grid tbody td:nth-child(6),
    .profile-grid tbody td:nth-child(7),
    .profile-grid tbody td:nth-child(8),
    .profile-grid tbody td:nth-child(9),
    .profile-grid tbody td:nth-child(10),
    .profile-grid tbody td:nth-child(11),
    .profile-grid tbody td:nth-child(12),
    .profile-grid tbody td:nth-child(13),
    .profile-grid tbody td:nth-child(14),
    .profile-grid tbody td:nth-child(15),
    .profile-grid tbody td:nth-child(16),
    .profile-grid tbody td:nth-child(17),
    .profile-grid tbody td:nth-child(18),
    .profile-grid tbody td:nth-child(19) {
        display: none;
    }

    /* Key metrics row styling */
    .profile-grid tbody td:nth-child(20), /* FitRep Score */
    .profile-grid tbody td:nth-child(21), /* RV */
    .profile-grid tbody td:nth-child(22) { /* Cum RV */
        background: #f8f9fa;
        padding: 8px 12px;
        border-radius: 8px;
        margin: 4px 0;
    }

    /* FitRep Score emphasis */
    .profile-grid tbody td:nth-child(20) {
        font-size: 18px;
        font-weight: 700;
        background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    }

    /* Actions cell */
    .profile-grid tbody td:last-child {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
        justify-content: center;
        gap: 8px;
    }

    .profile-grid tbody td:last-child::before {
        display: none;
    }

    .profile-grid tbody td:last-child button {
        flex: 1;
        min-height: 44px;
    }

    /* Horizontal scroll hint removed - using card layout instead */
    .table-responsive {
        overflow-x: visible;
    }
}

/* Even smaller screens - stack action buttons */
@media (max-width: 400px) {
    .profile-grid tbody td:last-child {
        flex-direction: column;
    }

    .profile-grid tbody td:last-child button {
        width: 100%;
    }

    #rankSummaryBar span {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    @page {
        size: letter;
        margin: 0.5in;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .header, .export-section, .warning-banner {
        display: none !important;
    }

    /* The adverse designation must remain visible in print; force a high-
       contrast border for monochrome printers. */
    .adverse-notice {
        border: 2px solid #000 !important;
    }
    
    .summary-card {
        background: white !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        page-break-inside: avoid;
        height: 100vh;
        overflow: hidden;
    }
    
    /* Add logo to print header */
    .summary-card::before {
        content: "";
        display: block;
        background-image: url("assets/images/Logo.png");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        height: 40px;
        margin-bottom: 8px;
    }
    
    .summary-card h2 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        text-align: center;
        border-bottom: 2px solid #333;
        padding-bottom: 4px !important;
    }
    
    .fitrep-average {
        background: #f0f0f0 !important;
        color: black !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
        margin: 6px 0 !important;
        text-align: center;
        border: 1px solid #333;
    }
    
    #evaluationMeta {
        font-size: 8px !important;
        margin: 4px 0 !important;
        text-align: center;
        border-bottom: 1px solid #ccc;
        padding-bottom: 4px !important;
    }
    
    .summary-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 3px !important;
        margin: 6px 0 0 0 !important;
        font-size: 8px !important;
    }
    
    .summary-item {
        background: #f8f9fa !important;
        padding: 4px !important;
        border-radius: 2px !important;
        border-left: 1px solid #333 !important;
        page-break-inside: avoid;
        margin: 0 !important;
        height: auto !important;
        overflow: hidden;
    }
    
    .summary-trait {
        font-size: 8px !important;
        font-weight: bold !important;
        margin-bottom: 1px !important;
        line-height: 1.1 !important;
    }
    
    .summary-grade {
        font-size: 9px !important;
        font-weight: bold !important;
        margin-bottom: 2px !important;
        line-height: 1.1 !important;
    }
    
    .summary-justification {
        font-size: 7px !important;
        line-height: 1.1 !important;
        max-height: 60px !important;
        overflow: hidden !important;
        margin: 0 !important;
        text-overflow: ellipsis;
        display: -webkit-box;
        line-clamp: 6;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
    }
    
    /* Force single page */
    .summary-card * {
        page-break-inside: avoid !important;
    }
    
    /* Ensure everything fits in available space */
.summary-grid {
    max-height: calc(100vh - 120px) !important;
    overflow: hidden !important;
}
    
    /* Hide non-essential elements */
    .help-button,
    .reevaluate-modal,
    .justification-modal,
    .help-modal {
        display: none !important;
    }
}

/* Profile header: name row with inline edit button */
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-name-row h2 {
    margin: 0;
}

/* From Uiverse.io by vinodjangid07 */
.editBtn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: none;
  background-color: rgb(93, 93, 116);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.123);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.editBtn::before {
  content: "";
  width: 200%;
  height: 200%;
  background-color: rgb(102, 102, 141);
  position: absolute;
  z-index: 1;
  transform: scale(0);
  transition: all 0.3s;
  border-radius: 50%;
  filter: blur(10px);
}
.editBtn:hover::before {
  transform: scale(1);
}
.editBtn:hover {
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.336);
}

.editBtn svg {
  height: 16px;
  fill: white;
  z-index: 3;
  transition: all 0.2s;
  transform-origin: bottom;
}
.editBtn:hover svg {
  transform: rotate(-15deg) translateX(5px);
}
.editBtn::after {
  content: "";
  width: 12px;
  height: 1.5px;
  position: absolute;
  bottom: 9px;
  left: -3px;
  background-color: white;
  border-radius: 2px;
  z-index: 2;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease-out;
}
.editBtn:hover::after {
  transform: scaleX(1);
  left: 0px;
  transform-origin: right;
}

/* Top-right Logout button styles (scoped) */
.Btn {
  --black: #000000;
  --ch-black: #141414;
  --eer-black: #1b1b1b;
  --night-rider: #2e2e2e;
  --white: #ffffff;
  --af-white: #f3f3f3;
  --ch-white: #e1e1e1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition-duration: .3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  background-color: var(--night-rider);
}
.Btn .sign {
  width: 100%;
  transition-duration: .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.Btn .sign svg {
  width: 17px;
}
.Btn .sign svg path {
  fill: var(--af-white);
}
.Btn .text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: var(--af-white);
  font-size: 1.2em;
  font-weight: 600;
  transition-duration: .3s;
}
.Btn:hover {
  width: 125px;
  border-radius: 5px;
  transition-duration: .3s;
}
.Btn:hover .sign {
  width: 30%;
  transition-duration: .3s;
  padding-left: 20px;
}
.Btn:hover .text {
  opacity: 1;
  width: 70%;
  transition-duration: .3s;
  padding-right: 10px;
}
.Btn:active {
  transform: translate(2px ,2px);
}

/* Inline input validation hints */
.input-hint {
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.2;
  opacity: 0.9;
}
.hint-ok { color: #2e7d32; }
.hint-warn { color: #b23b3b; }
.hint-info { color: #1565c0; }
.strength-weak { color: #b23b3b; }
.strength-medium { color: #b26b00; }
.strength-strong { color: #2e7d32; }

/* Accessible button state hooks */
.btn.is-loading,
.Btn.is-loading,
.editBtn.is-loading {
  position: relative;
  pointer-events: none;
}
.btn.is-loading::after,
.Btn.is-loading::after,
.editBtn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  border-top-color: rgba(255,255,255,0.1);
  animation: sa-spin 0.8s linear infinite;
}
@keyframes sa-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.btn.is-disabled,
.Btn.is-disabled,
.editBtn.is-disabled,
.btn[aria-disabled="true"],
.Btn[aria-disabled="true"],
.editBtn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Tooltip styling */
.sa-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: auto;
  opacity: 0;
  transform: translate(-9999px, -9999px) scale(0.98);
  transition: opacity 120ms ease, transform 120ms ease;
}
.sa-tooltip.show {
  opacity: 1;
  transform: translate(var(--x, -9999px), var(--y, -9999px)) scale(1);
}
.sa-tooltip.hide {
  opacity: 0;
}
.sa-tooltip-inner {
  max-width: 280px;
  background: #1f2937;
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  font-size: 12px;
  line-height: 1.4;
}
/* ===== Modal Stacking & Backdrop ===== */
body.sa-modal-open {
  overflow: hidden !important;
}

.sa-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(1.2) blur(1px);
  transition: opacity 120ms ease;
  opacity: 1;
}

.save-profile-modal {
  transition: opacity 160ms ease, transform 160ms ease;
}
.save-profile-modal.active {
  opacity: 1;
  transform: translateY(0);
}
.save-profile-modal.sa-modal-background .save-profile-content {
  opacity: 0.65;
  pointer-events: none;
}

/* ===== Form Validation States ===== */
.form-input.is-invalid {
  border-color: #d32f2f;
  box-shadow: 0 0 0 2px rgba(211,47,47,0.12);
}
.form-input.is-valid {
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.12);
}
.form-input.is-neutral {
  border-color: #ced4da;
  box-shadow: none;
}
.input-error {
  margin-top: 6px;
  font-size: 12px;
  color: #d32f2f;
  /* animated visibility */
  opacity: 0;
  transform: translateY(-2px);
  height: 0;
  overflow: hidden;
  transition: opacity 160ms ease, transform 160ms ease;
}
.input-error.show {
  opacity: 1;
  transform: translateY(0);
  height: auto;
}
.valid-indicator {
  margin-left: 8px;
  color: #4CAF50;
  font-weight: 700;
  /* animated visibility */
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}
.valid-indicator.show {
  opacity: 1;
  transform: scale(1);
}
.form-group { position: relative; }
.form-group .valid-indicator {
  position: absolute;
  right: 8px;
  top: 36px;
  pointer-events: none;
}
.form-success-banner {
  background: #e8f5e8;
  border-left: 4px solid #4CAF50;
  padding: 10px 12px;
  border-radius: 6px;
  color: #2e7d32;
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 10000;
  transition: opacity 200ms ease, transform 200ms ease;
}
.form-success-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Mobile-friendly touch targets (WCAG 2.5.5 - 44px minimum) */
.form-input, .btn { min-height: 44px; }

/* ==============================================
   Dark Mode Support (Class-based toggle)
   Comprehensive dark theme with high contrast text
   ============================================== */
body.dark {
    background: #020617;
    color: #f1f5f9;
}

/* Container */
body.dark .container {
    background: transparent;
}

/* Header */
body.dark .header {
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid #475569;
    border-bottom: 1px solid #334155;
}

body.dark .header h1 {
    color: #f8fafc;
}

body.dark .header-subtitle {
    color: #cbd5e1;
}

body.dark .header-info {
    border-color: #334155;
}

body.dark .header-credit {
    color: #93c5fd;
}

body.dark .header-divider {
    color: #64748b;
}

body.dark .header-link {
    color: #7dd3fc;
}

body.dark .header-link:hover {
    color: #bae6fd;
}

/* Theme toggle in dark mode */
body.dark .theme-toggle {
    background: rgba(255,255,255,0.1);
    border-color: #475569;
    color: #f1f5f9;
}

body.dark .theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: #64748b;
}

/* Cards */
body.dark .setup-card,
body.dark .evaluation-card,
body.dark .review-card,
body.dark .summary-card,
body.dark .directed-comments-card,
body.dark .section-i-generation-card,
body.dark .profile-card {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid #475569;
    color: #f1f5f9;
}

/* Form elements */
body.dark .form-input,
body.dark .setup-select,
body.dark select,
body.dark textarea {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

body.dark .form-input:focus,
body.dark .setup-select:focus,
body.dark select:focus,
body.dark textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

body.dark .form-input::placeholder {
    color: #94a3b8;
}

body.dark .form-label {
    color: #e2e8f0;
}

/* Buttons */
body.dark .btn {
    border-color: #475569;
}

body.dark .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}

body.dark .btn-secondary {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

body.dark .btn-secondary:hover {
    background: #475569;
}

/* Progress bar */
body.dark .progress-bar {
    background: #334155;
}

body.dark #progressText {
    color: #f8fafc;
}

/* Section titles */
body.dark .setup-title {
    color: #f8fafc;
}

/* Grade display */
body.dark .grade-display {
    background: #1e293b;
    border-color: #475569;
}

body.dark .grade-description {
    color: #f8fafc;
}

/* Accordion */
body.dark .completed-traits-accordion {
    background: #1e293b;
    border-color: #334155;
}

body.dark .accordion-item {
    border-color: #334155;
    background: #1e293b;
}

body.dark .accordion-header {
    color: #f1f5f9;
}

body.dark .accordion-trait-item {
    background: #020617;
    border-color: #334155;
}

body.dark .accordion-trait-item:hover {
    background: #0f172a;
}

body.dark .accordion-trait-name {
    color: #7dd3fc;
}

body.dark .accordion-trait-justification {
    background: #020617;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark .accordion-content {
    background: #020617;
}

/* Modals */
body.dark .modal-content,
body.dark .justification-modal-content,
body.dark .reevaluate-modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

/* Auto-save indicator */
body.dark .auto-save-indicator {
    color: #cbd5e1;
}

body.dark .auto-save-indicator.saved .text {
    color: #4ade80;
}

body.dark .auto-save-indicator.error .text {
    color: #f87171;
}

/* Tables */
body.dark table {
    background: #1e293b;
}

body.dark th {
    background: #0f172a;
    color: #f8fafc;
}

body.dark td {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark tr:hover td {
    background: #334155;
}

/* Breadcrumbs */
body.dark .breadcrumbs a {
    color: #7dd3fc;
}

body.dark .breadcrumbs .sep {
    color: #64748b;
}

/* Help section */
body.dark .help-section {
    background: #0f172a;
    border-color: #334155;
}

/* Toast messages */
body.dark .toast {
    background: #334155;
    color: #f8fafc;
}

/* Profile dashboard dark mode */
body.dark .profile-header-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.dark .profile-info h2 {
    color: #f8fafc;
}

body.dark .profile-info p {
    color: #cbd5e1;
}

body.dark .stat-value {
    color: #7dd3fc;
}

body.dark .stat-label {
    color: #94a3b8;
}

body.dark .mode-selection-card,
body.dark #modeSelectionCard {
    background: rgba(30, 41, 59, 0.95);
    color: #f1f5f9;
}

body.dark .mode-selection-card h2,
body.dark #modeSelectionCard h2 {
    color: #f8fafc;
}

body.dark .mode-selection-card p,
body.dark #modeSelectionCard p {
    color: #cbd5e1;
}

/* Rank Summary toolbar dark mode */
body.dark .summary-title {
    color: #f8fafc;
}

body.dark .sort-label {
    color: #94a3b8;
}

body.dark .sort-btn {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark .sort-btn:hover {
    background: #475569;
}

body.dark .sort-btn.active {
    background: #c2185b;
    color: #ffffff;
    border-color: #f472b6;
}

/* Rank summary cards dark mode */
body.dark .rank-summary-card {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

/* Profile grid (evaluations table) dark mode */
body.dark .profile-grid-wrapper {
    background: #1e293b;
}

body.dark .profile-grid thead th {
    background: #0f172a;
    color: #f8fafc;
    border-bottom: 2px solid #475569;
}

body.dark .profile-grid tbody td {
    color: #e2e8f0;
    border-top: 1px solid #475569;
}

body.dark .profile-grid tbody tr {
    background: #1e293b;
}

body.dark .profile-grid tbody tr:nth-child(even) {
    background: #0f172a;
}

body.dark .profile-grid tbody tr:hover {
    background: #334155;
}

body.dark .profile-grid tbody td:nth-child(2) {
    color: #7dd3fc;
}

body.dark .profile-grid .avg-cell {
    color: #7dd3fc;
}

/* Force-left placement override for floating feedback button */
#feedbackFloatingBtn {
  position: fixed !important;
  left: 0 !important;
  right: auto !important;
  transform: none !important;
}

@media (max-width: 480px) {
  #feedbackFloatingBtn {
    left: 0 !important;
    right: auto !important;
    transform: none !important;
  }
}
#rankSummaryBar{
    display:flex;
    align-items:center;
    gap:12px;
}
#rankSummaryBar span{
    display:inline-flex;
    align-items:center;
    line-height:1;
}

/* ==============================================
   Compact Header Mode (Evaluation Sections)
   - Shows only logo + title in row 1
   - Shows progress section in row 2
   - Hides all other header elements
   ============================================== */
.header.compact {
    padding: 14px 16px;
}

/* Compact branding - horizontal layout */
.header.compact .header-branding {
    justify-content: flex-start;
    margin-bottom: 0;
    gap: 12px;
}

.header.compact .header-logo {
    max-height: 36px;
    max-width: 36px;
}

.header.compact .header-titles {
    text-align: left;
}

.header.compact h1 {
    font-size: 1.1rem;
}

.header.compact .header-subtitle {
    display: none;
}

/* Hide non-essential elements in compact mode */
.header.compact .header-info {
    display: none;
}

/* Show and style nav in compact mode */
.header.compact .header-nav {
    display: block;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* Show and style progress section in compact mode */
.header.compact .progress-section {
    display: block;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* Mobile adjustments for compact header */
@media (max-width: 600px) {
    .header.compact {
        padding: 12px;
    }

    .header.compact .header-branding {
        gap: 10px;
    }

    .header.compact .header-logo {
        max-height: 32px;
        max-width: 32px;
    }

    .header.compact h1 {
        font-size: 1rem;
    }

    .header.compact .progress-section {
        margin-top: 10px;
        padding-top: 10px;
    }
}

/* Mobile adjustments for full header */
@media (max-width: 600px) {
    .header {
        padding: 16px;
    }

    .header-branding {
        flex-direction: column;
        gap: 10px;
    }

    .header-titles {
        text-align: center;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .header-info {
        gap: 8px;
        padding: 10px 0;
    }

    .header-divider {
        display: none;
    }

    .header-credit,
    .header-link {
        font-size: 0.75rem;
    }
}

/* ==============================================
   Completed Traits Accordion
   Shows previously evaluated traits during the
   evaluation step in a collapsible accordion.
   Section headers are clickable accordion triggers.
   ============================================== */
.completed-traits-accordion {
    max-width: 100%;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    background: #fff;
}

.accordion-item {
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.accordion-item:last-of-type {
    border-bottom: none;
}

/* Hide the native checkbox input */
.accordion-item input[type="checkbox"] {
    display: none;
}

/* Accordion header styling - Section header trigger */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    user-select: none;
}

/* Section header style (blue gradient) */
.accordion-header.accordion-section-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
}

.accordion-header.accordion-section-header:hover {
    background: linear-gradient(135deg, #162d5a 0%, #1e3c72 100%);
}

/* Active/checked section header state */
.accordion-item input:checked + .accordion-header.accordion-section-header {
    background: linear-gradient(135deg, #0f1f3d 0%, #1e3c72 100%);
}

/* Accordion header content layout */
.accordion-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Section title in header */
.accordion-section-title {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Trait count badge */
.accordion-trait-count {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

/* Chevron icon */
.accordion-icon {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.25s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.accordion-item input:checked + .accordion-header .accordion-icon {
    transform: rotate(90deg);
    color: #fff;
}

/* Accordion content panel */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, padding 0.35s ease;
    padding: 0;
    background: #f8fafc;
}

.accordion-item input:checked ~ .accordion-content {
    max-height: 2000px;
    padding: 0;
}

/* ==============================================
   New Components (How It Works Card)
   ============================================== */
.info-card-title {
    color: #1e3c72;
    margin-bottom: 10px;
}

.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.decision-box {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.decision-not-meet {
    background: #ffe6e6;
}

.decision-meets {
    background: #e8f5e8;
}

.decision-surpasses {
    background: #e3f2fd;
}

.decision-title-not-meet {
    color: #d32f2f;
}

.decision-title-meets {
    color: #2e7d32;
}

.decision-title-surpasses {
    color: #1976d2;
}

.result-box {
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.result-box-title {
    color: #1565c0;
    margin-bottom: 8px;
}

/* ==============================================
   Dark Mode Additions
   ============================================== */

/* Profile System Dark Mode Fixes */
body.dark .profile-title {
    color: #7dd3fc; /* Matches .header-link */
}

body.dark .profile-description {
    color: #e2e8f0; /* Matches .form-label */
}

body.dark .rank-chip {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
}

body.dark .metric-value {
    color: #f1f5f9;
}

/* How It Works Card Dark Mode */
body.dark .info-card-title {
    color: #f8fafc;
}

body.dark .decision-not-meet {
    background: rgba(220, 38, 38, 0.2);
}

body.dark .decision-meets {
    background: rgba(22, 163, 74, 0.2);
}

body.dark .decision-surpasses {
    background: rgba(37, 99, 235, 0.2);
}

body.dark .decision-title-not-meet {
    color: #fca5a5;
}

body.dark .decision-title-meets {
    color: #86efac;
}

body.dark .decision-title-surpasses {
    color: #93c5fd;
}

body.dark .result-box {
    background: rgba(30, 41, 59, 0.5);
    border-left-color: #60a5fa;
    color: #e2e8f0;
}

body.dark .result-box-title {
    color: #bfdbfe;
}

/* Individual trait items inside accordion */
.accordion-trait-item {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.accordion-trait-item:last-child {
    border-bottom: none;
}

.accordion-trait-item:hover {
    background: #f8fafc;
}

/* Trait row with name and grade */
.accordion-trait-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.accordion-trait-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e3c72;
    flex: 1;
    min-width: 0;
}

/* Grade description text styling */
.accordion-grade-desc {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Per-grade accordion colors removed: the grade is no longer shown mid-flow
   (left-to-right method); the accordion-grade-desc chip is no longer rendered. */

/* Trait justification text */
.accordion-trait-justification {
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    white-space: pre-line;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    border-left: 3px solid #d1d5db;
}

/* Re-evaluate button */
.accordion-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #1e3c72;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
}

.accordion-edit-btn:hover {
    background: #1e3c72;
    color: #fff;
    border-color: #1e3c72;
}

/* Mobile adjustments for accordion */
@media (max-width: 600px) {
    .accordion-header {
        padding: 12px 14px;
    }

    .accordion-section-title {
        font-size: 12px;
    }

    .accordion-trait-count {
        font-size: 10px;
        padding: 2px 8px;
    }

    .accordion-trait-item {
        padding: 12px 14px;
    }

    .accordion-trait-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .accordion-trait-name {
        font-size: 13px;
        flex-basis: 100%;
    }

    .accordion-grade-desc {
        font-size: 10px;
        padding: 3px 8px;
    }

    .accordion-trait-justification {
        font-size: 12px;
        padding: 8px 10px;
    }

    .accordion-edit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==============================================
   What's New Inline Section
   ============================================== */
.whats-new-inline {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.whats-new-inline-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3c72;
    margin: 0 0 16px 0;
    text-align: center;
}

.update-section {
    margin-bottom: 20px;
}

.update-section:last-child {
    margin-bottom: 0;
}

.update-date {
    font-size: 14px;
    font-weight: 700;
    color: #1e3c72;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e7eb;
}

.update-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.update-list li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.update-list li:last-child {
    margin-bottom: 0;
}

.update-list strong {
    color: #1e3c72;
}

/* Dark mode for What's New inline */
body.dark .whats-new-inline {
    border-color: #334155;
}

body.dark .whats-new-inline-title {
    color: #7dd3fc;
}

body.dark .update-date {
    color: #7dd3fc;
    border-color: #334155;
}

body.dark .update-list li {
    color: #e2e8f0;
}

body.dark .update-list strong {
    color: #7dd3fc;
}

/* Additional Dark Mode Fixes */
body.dark .save-profile-content,
body.dark .sa-modal-panel {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155;
}

body.dark .guidance-question {
    color: #f1f5f9;
}

body.dark .guidance-question strong {
    color: #7dd3fc;
}

/* Evaluation Flow Dark Mode Fixes */
body.dark .section-context {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-left-color: #60a5fa;
}

body.dark .section-title {
    color: #f1f5f9;
}

body.dark .section-progress-text {
    color: #94a3b8;
}

body.dark .section-description {
    color: #cbd5e1;
}

body.dark .section-importance {
    color: #94a3b8;
}

body.dark .trait-subtitle {
    color: #60a5fa;
}

body.dark .trait-description {
    color: #94a3b8;
}

body.dark .grade-context {
    background: #1e293b;
}

body.dark .grade-level {
    color: #60a5fa;
}

body.dark .grade-meaning {
    color: #94a3b8;
}

body.dark .evaluation-guidance {
    background: #334155;
    border-left-color: #fbbf24;
}

/* Navigation Helper */
body.dark .navigation-helper {
    background: #1e293b;
    border-top-color: #334155;
}

body.dark .overall-progress {
    color: #94a3b8;
}

body.dark .remaining-sections {
    color: #64748b;
}

/* Validation Panel */
body.dark .validation-panel {
    background: #1e293b;
}

body.dark .validation-success {
    background: rgba(22, 163, 74, 0.2);
    border-left-color: #4ade80;
    color: #f1f5f9;
}

body.dark .validation-icon {
    color: #4ade80;
}

body.dark .validation-summary {
    border-bottom-color: #334155;
}

body.dark .validation-summary h4 {
    color: #f1f5f9;
}

body.dark .error-count {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border-color: #991b1b;
}

body.dark .warning-count {
    background: rgba(234, 88, 12, 0.2);
    color: #fb923c;
    border-color: #9a3412;
}

/* Justification & Help Modal Dark Mode */
body.dark .justification-content,
body.dark .help-content {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

body.dark .justification-header {
    border-bottom-color: #334155;
}

body.dark .justification-title {
    color: #f1f5f9;
}

body.dark #justificationDesc {
    color: #e2e8f0;
}

body.dark .tool-btn {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark .tool-btn:hover {
    background: #475569;
}

body.dark .tool-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

body.dark .textarea-info {
    color: #94a3b8;
}

body.dark .word-count {
    color: #94a3b8;
}

body.dark .btn-save {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

body.dark .btn-cancel {
    background: #475569;
    color: #f1f5f9;
}

body.dark .btn-cancel:hover {
    background: #64748b;
}

body.dark .justification-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark .justification-textarea:focus {
    border-color: #60a5fa;
}

/* ========================================
   Disclaimer Footer Styles
   ======================================== */

.disclaimer-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-top: 2px solid #d97706;
    padding: 8px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.disclaimer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: #78350f;
}

.disclaimer-category,
.disclaimer-level {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.disclaimer-separator {
    font-weight: 700;
    color: #92400e;
    padding: 0 4px;
}

.disclaimer-notice {
    font-weight: 500;
}

/* Responsive adjustments for footer */
@media (max-width: 768px) {
    .disclaimer-footer {
        padding: 10px 12px;
        font-size: 11px;
    }

    .disclaimer-content {
        flex-direction: column;
        gap: 4px;
    }

    .disclaimer-separator {
        display: none;
    }

    .disclaimer-category,
    .disclaimer-level {
        display: block;
        font-size: 10px;
    }

    .disclaimer-notice {
        display: block;
        font-size: 11px;
        margin-top: 4px;
    }
}

/* Add padding to body to prevent content from being hidden behind footer */
body {
    padding-bottom: 50px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 90px;
    }
}

/* Dark mode footer styles */
body.dark .disclaimer-footer {
    background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
    border-top-color: #fbbf24;
}

body.dark .disclaimer-content {
    color: #fef3c7;
}

body.dark .disclaimer-separator {
    color: #fcd34d;
}

