/* =========================
   Global tuning knobs
   ========================= */
   :root {
    /* Shared label font (left + bottom labels) */
    --axis-label-font: clamp(1.00rem, 1.6vw, 1.15rem);
  
    /* Box baseline sizing (tweak these!) */
    --box-min-width: 350px;     /* try 280px / 300px */
    --box-min-height: 175px;    /* try 170px / 180px */
  
    /* Layout spacing (tweak these!) */
    --page-top-offset: 100px;   /* moves whole layout down */
    --grid-to-axis-gap: 35px;   /* space between grid and bottom axis */
    --grid-gap: 1px;

    --arrow-size: clamp(
        420px,                       /* minimum */
        calc(3 * var(--box-min-width)),
        700px                        /* maximum */
      );
  }
  
  /* =========================
     Page shell
     ========================= */
  .App {
    background-color: hwb(0 100% 0%);
    padding-top: var(--page-top-offset);
  }

  /* =========================
     Ninebox Header
     ========================= */
  .ninebox-header {
    width: 100%;
    background-color: #ffffff;
    padding: 15px 25px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
  }

  .ninebox-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
  }

  .viewing-label {
    font-family: 'Assistant', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
  }

  .ninebox-header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
  }

  .btn-manager-settings,
  .btn-switch-manager {
    background-color: #99CC33;
    border: none;
    border-radius: 20px;
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    padding: 8px 20px;
    font-size: 0.95rem;
    box-shadow: 2px 2px 5px #666666;
    cursor: pointer;
    color: #000;
    transition: opacity 0.2s;
  }

  .btn-manager-settings:hover,
  .btn-switch-manager:hover {
    opacity: 0.75;
  }

  .btn-manager-settings:active,
  .btn-switch-manager:active {
    background-color: #739926;
    opacity: 1;
  }

  .switch-manager-dropdown {
    position: relative;
    display: inline-block;
  }

  .manager-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
  }

  .manager-dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: #333;
    transition: background-color 0.2s;
  }

  .manager-dropdown-item:hover {
    background-color: #f0f0f0;
  }

  .manager-dropdown-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }

  .manager-dropdown-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }
  
  .App-link {
    color: #61dafb;
  }
  
  @keyframes App-logo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  
  /* =========================
     Header / main layout
     ========================= */
  .App-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* was center; this removed your huge gap */
    width: 100%;
    min-height: auto;
    padding-top: 10px;
    padding-bottom: 0;
  }
  
  .allRankingBoxes {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
  }
  
  /* =========================
     3x3 ranking grid
     ========================= */
  .rankedMembers {
    display: grid;
    gap: var(--grid-gap);
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    margin: 25px 25px 0 25px;
    align-items: stretch;
  
    width: fit-content;
  
    /* keep the overall grid from collapsing narrower than the 3 columns */
    min-width: calc(3 * var(--box-min-width));
  }
  
  /* Left side "Team" column */
  .unrankedMembers {
    display: flex;
    flex-direction: column;
    margin: 0 15px;
    background-color: transparent;
    min-width: 220px;
    align-self: flex-start;
  }
  
  .unrankedMembers > div > p {
    margin: 0;
    padding: 0;
    font-size: calc(10px + 1.5vmin);
    text-align: left;
    font-weight: normal;
  }
  
  .vertArrow {
    display: flex;
    align-items: center;
    height: calc(3 * var(--box-min-height));
  }
  
  
  .vertHeaderColumn {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: var(--grid-gap);
    align-items: stretch;
    justify-items: center;
    align-self: stretch;
    margin-right: 10px;
    min-width: 60px;
  }
  
  /* Rotation stays on the container */
  .vertHeader {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-90deg);
    white-space: nowrap;
  }
  
  /* Font lives on the text */
  .vertHeader p {
    font-size: var(--axis-label-font);
    margin: 0;
    white-space: nowrap;
  }
  
  /* =========================
     Rank box styles
     ========================= */
  .rank1, .rank5, .rank9,
  .rank2, .rank6,
  .rank3,
  .rank4, .rank8,
  .rank7 {
    display: flex;
    flex-direction: column;
    align-items: center;
  
    /* baseline size knobs */
    min-width: var(--box-min-width);
    min-height: var(--box-min-height);
  
    width: 100%;
    height: 100%;
    border-radius: 5px;
  }
  
  /* Colors */
  .rank1, .rank5, .rank9 { background: #31C4A5; }
  .rank2, .rank6 { background: #C1E084; }
  .rank3 { background: #99CC33; }
  .rank4, .rank8 { background: #95F2F8; }
  .rank7 { background: #F8B058; }
  
  /* Fluid typography for box titles - scales with container width */
  .rank1 > p, .rank2 > p, .rank3 > p, .rank4 > p, .rank5 > p,
  .rank6 > p, .rank7 > p, .rank8 > p, .rank9 > p {
    margin: 0;
    padding: 8px 4px;
    font-size: clamp(0.75rem, 1.5vw, 1.1rem);
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
  }
  
  /* =========================
     Drag and drop visual feedback (RESTORED)
     ========================= */
  .dropTarget {
    outline: 3px dashed rgba(0, 0, 0, 0.6);
    outline-offset: -6px;
    transform: scale(1.01);
    filter: brightness(1.05);
    transition: all 0.15s ease;
  }
  
  .dropSuccess {
    animation: dropPulse 250ms ease-out;
  }
  
  @keyframes dropPulse {
    0% { transform: scale(1.00); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1.00); }
  }
  
  /* OPTIONAL shake (only used if you add class="dropShake" somewhere) */
  .dropShake {
    animation: dropShake 280ms ease-in-out;
  }
  
  @keyframes dropShake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
    100% { transform: translateX(0); }
  }
  
  /* =========================
     Team members list styling
     ========================= */
  .teamMembers {
    min-height: 60px;
    padding: 8px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  
  /* employee "cards" */
  .teamMembers li {
    list-style: none; /* safe even if li isn't inside ul */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #D9D9D9;
    border-radius: .2em;
    padding: .5em .8em .5em .5em;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    margin-bottom: 1em;
  }
  
  .teamMembers p {
    max-width: none;
    font-weight: normal;
    font-size: medium;
    margin: 0;
    align-items: center;
    text-align: center;
  }
  
  .teamMembers-thumb {
    overflow: hidden;
    flex-shrink: 0;
    width: 2em;
    height: 2em;
    background-color: #e8e8e8;
    padding: .5em;
    margin-right: .5em;
  }
  
  .capitalizeName {
    text-transform: capitalize;
  }
  
  .teamMembers-thumb img {
    display: block;
    width: 100%;
    height: auto;
  }
  
  /* =========================
     Modal + misc
     ========================= */
  .modalHeader {
    color: #ffffff;
    text-shadow: 2px 2px 4px #000000;
    margin: 5px 0 5px 0;
  }
  
  .modalText {
    color: #ffffff;
    text-shadow: 2px 2px 4px #000000;
    margin: 5px 0 5px 0;
  }
  
  #modalX {
    padding-left: 375px;
  }
  
  .teamMembersHidden {
    display: none;
  }
  
  .teamMembersShown {
    display: block;
  }
  
  /* =========================
     Bottom axis (headers + arrow)
     ========================= */
  .horizArrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
  
    /* tweakable spacing */
    margin-top: var(--grid-to-axis-gap);
    margin-bottom: 0;
    padding: 0 25px;
  }
  
  /* Bottom labels align to the same 3 columns as the ranked grid */
  .horizHeaderRow {
    display: grid;
    grid-template-columns: repeat(3, var(--box-min-width)); /* key alignment */
    gap: var(--grid-gap);
    width: fit-content;
    margin: 0 auto 6px auto;
    justify-items: stretch;
  }
  
  .horizHeader {
    display: flex;
    justify-content: flex-start; /* left-align the content block */
    align-items: center;
    padding: 5px;
  }
  
  .horizHeader p {
    width: 100%;
    text-align: left;  
    padding-left: 12px;       
    font-size: var(--axis-label-font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  
    /* optional: small inset so it doesn't hug the edge */
    padding-left: 6px;
  }
  
  .successorCrown {
    color: rgb(30,48,80);
    margin-left: 10px;
  }
  
  .horizArrow img {
    display: block;
    width: var(--arrow-size);
    height: auto;        /* preserve aspect ratio */
    margin: 0 auto;
  }

  /* =========================
     Read-Only Mode Styles
     ========================= */
  .read-only-banner {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 20px;
    margin: 0 25px 20px 25px;
    display: flex;
    align-items: center;
    color: #856404;
    font-size: 0.95rem;
  }

  .read-only-banner i {
    font-size: 1.1rem;
  }

  /* Grey out read-only boxes */
  .read-only {
    opacity: 0.6;
    filter: grayscale(0.3);
  }

  /* Re-enable pointer events for content inside (for tooltips, etc.) but disable drag */
  .read-only .teamMembers {
    pointer-events: auto;
  }

  .read-only .teamMembers li {
    cursor: not-allowed !important;
  }

  .read-only-item {
    cursor: not-allowed !important;
    opacity: 0.7;
  }
  
  .memberTitle {
    display: none;
    font-size: 0.85rem;
    margin-top: 2px;
    opacity: 0.85;
  }
  
  .teamMembers li:hover .memberTitle {
    display: block;
  }
  
  .teamMembers li {
    cursor: grab;
    user-select: none;
  }
  
  .teamMembers li:active {
    cursor: grabbing;
  }
  
  /* Let the LI receive the drag gesture even when you click on the text */
  .teamMembers li .memberName,
  .teamMembers li .memberTitle {
    pointer-events: none;
  }
  