/* General body styling */


:root {
    --primary-color: #4a90e2;
    --secondary-color: #5b9d73;
    --accent-color: #E3574B;
    --Referencelist1-color: #d3d3d3;
    --Referencelist2-color: #a9a9a9;
    --grey:

}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    background-color: #f9f9f9;
    color: #333;
}



/* Controls area at the top of the page */
#controls {
    padding: 5px;
    background: var(--primary-color);  
    color: #fff;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 15px;
    padding-right: 15px;
}

#rightCON {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 5px;
}

#controls img {
    height: 30px;
    margin-right: 10px;
}

#notification {
    margin-top: 10px;
    display: none;
    border: 2px solid white;
    width: 300px;
    padding: 10px;
    text-align: center;
}

/* Viewer and Frame styling */
#viewer {
    display: flex;
    flex: 1;
    overflow-y: hidden;
}

.frame {
    width: 50%;
    height: 95%;
    overflow-y: auto;
    overflow-x: auto;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 5px;
    background-color: #fff;
    border-radius: 5px;
}

.OuterFrame {
    
    background-color: #f0f0f0;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 5px;
    flex: 1 1; 
    overflow: hidden;
    
}
.OuterFrame2 {
    
    background-color: #f0f0f0;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 5px;

    overflow: hidden;
    
}
.search-string-frame, 
.result-frame {
    border: 1px solid #ccc;
    padding-left: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    background-color: #f0f0f0;
}

.Reference-frame {
    border: 1px solid #ccc;
    padding-bottom: 5px;
    padding-top: 5px;
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    background-color: #FFFFFF;
    position: relative;
}

.Reference-frame.uncited {
  position: relative;
  /* border-left: 6px solid var(--accent-color); /* optional extra accent */
  /* border-right: 6px solid var(--accent-color); /* optional extra accent */
  padding-left: 40px; /* space for the exclamation */
}

.Reference-frame.uncited::before {
  content: "❗";
  position: absolute;
  left: 0px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  color: red;
}



.Reference-frameDESK {
    border: 1px solid #ccc;
    padding-bottom: 5px;
    padding-top: 5px;
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    background-color: #FFFFFF;
    position: relative;
}

#ReferenceFrame {
    max-height: calc(100% - 50px)

}
#description {
  height: 100%;
}

#pdf_frame {
    background-color: #FFFFFF;
    margin-bottom: 15px;
    padding: 10px;
    text-align: justify;
    border: 1px solid #ddd;
    flex: 1 1 auto; /* Takes remaining space */
    overflow-y: auto; /* Scroll PDF content */
    background-color: #FFFFFF;
    padding: 10px;
    text-align: justify;
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

.InTexts {
    border: 1px solid #ccc;
    margin-right: 5px;
    padding: 5px 10px; /* Combines top/bottom and left/right padding */
    margin-bottom: 5px;
    border-radius: 5px;
    background-color: #FFFFFF;
    position: relative;
    display: inline-block; /* Ensures the width fits the content */
    white-space: nowrap; /* Prevents the content from wrapping to the next line */
    cursor: pointer; /* Makes the element look clickable */
}


#dragArea {
    width: 100%;
    height: 300px;
    border: 2px dashed var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    color: #333;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
}

/* PDF upload button */
#pdf-upload {
    margin-bottom: 10px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#pdf-upload:hover {
    background-color: var(--primary-color);
}

/* Text Layer styling */
.textLayer {
    position: relative;
    pointer-events: auto;
    display: block;
}

.textLayer > div {
    position: absolute;
    transform-origin: 0% 0%;
}

.textLayer .endOfContent {
    display: none;
}

/* Highlighting references */
.highlight {
    z-index: 1000;
}

/* Result item and active button */
.result-item {
    margin-bottom: 20px;
}

.result-item p {
    margin: 0;
}

.active {
    background-color: #ccc;
}

/* Citation highlighting */
.citation {
    background-color: var(--secondary-color); 
    font-weight: bold;
    padding: 2px;
    border-radius: 5px; 
}

.DoHighlights {
    border: 4px solid #FFD700; /* Border color and thickness when active */
    border-color: transparent; /* Border will fade out */

}

.citationDESK {
    background-color: var(--secondary-color); 
    font-weight: bold;
    padding: 2px;
    border-radius: 5px; 
}

/* Collapsible frame with smooth transition */
.collapsible-frame {
    overflow-y: auto;
    transition: max-height 0.3s ease-out;
}

/* In-text citation toggle button */
.toggle-in-text-button {
    cursor: pointer;
    margin-bottom: 0px;
    margin-left: auto;
}

/* Adjust image size within controls */
#controls img {
    height: 30px;
    margin-right: 10px;
}




.button {
    padding: 10px 15px;
    text-align: center;
    cursor: pointer;
    outline: none;
    color: #0b0a0a;
    background-color: White;
    border: 2px solid grey;
    border-radius: 5px;
    box-shadow: 0 7px 10px #999;
  }
  
  .button:hover {
    background-color: #4a90e2}
  
  .button:active {
    background-color: #4a90e2;
    box-shadow: 0 5px 10px #666;
    transform: translateY(4px);
  }

.buttoncontainer {
    position: absolute;  /* Position the buttons absolutely */
    top: 5%;           /* Aligns the buttons to the top of the container */
    right: 5px;

}

/* Controls styling for button, file input, and select dropdown */
#controls button,
#controls input[type="file"],
#controls select {
    margin-left: 10px;
    padding: 10px 5px;
    width: 190px;
    background-color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: #333;
}

#controls button.active {
    background-color: #333;
    color: #fff;
}

/* Button active style */
button.active {
    background-color: #ccc;
}

/* Left column */
#left-column {
    width: 60px;
    background-color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ccc;
}

/* Additional frame styles */
.frame {

}

#pdf_dummy {
  height: 100%;
}

#pdf-container {

  overflow: hidden;              /* prevent double scrollbars */
}

#dummy {
    transform-origin: 0 0; /* Keeps the zoom effect centered */
    /*transition: transform 0.2s ease-in-out;  Smooth zoom effect */
    
}
.textLayer{
    transform-origin: 0 0; /* Keeps the zoom effect centered */
    /*transition: transform 0.2s ease-in-out;  Smooth zoom effect */

}

/* Notification styles for CrossRef results */
.notification {
    background-color: white;
    border: 2px solid white;
    width: 300px;
    padding: 10px;
    text-align: center;
    margin-top: 10px;
}

.crossref-search-button {

    marginBottom : '0px'; 
    marginLeft : '15px';
}

.Scholar-search-button {
margin-left : 3px;

}

.spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 20px; /* Small size */
    height: 20px;
    animation: spin 1s linear infinite; /* Faster spin */
    display: none; /* Initially hidden */
    margin-left: 10px;
  }
  
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  #referenceHeadline {
    display: flex;
    align-items: center; /* Vertically centers items (optional) */
    justify-content: flex-start; /* Default: Aligns items to the left */
    padding: 10px;               /* Add some padding around the container */
    padding-right: 0px;  
    gap: 10px; /* Add space between the left elements */

    
}

#SearchCintainer {
  display: flex;
  align-items: center; /* vertically center text and input */
  gap: 8px;            /* space between counter and field */
  margin-right: 10px;
  margin-left: auto; 
}

#SearchCounter {
  font-weight: bold;
  white-space: nowrap; /* prevent breaking into multiple lines */
}

#searchSpanField {
  flex: 1;             /* allow it to grow */
  padding: 4px 6px;
  font-size: 0.9em;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100px
}
  #pdf_frame_head {
    flex: 0 0 auto;
    align-items: center; /* Vertically centers items (optional) */
    justify-content: flex-start; /* Default: Aligns items to the left */
    padding: 5px;               /* Add some padding around the container */
    padding-right: 0px;  
    gap: 10px; /* Add space between the left elements */

    
}

#zoomcontainer {
  display: flex;
  gap: 8px;
  padding-right: 10px;
}

#zoomcontainer button:hover {
  background: #eee;
}

#right_grey_container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
}

#ThirdFrameHead {
    padding: 10px;

    display: flex;
    flex-direction: row;
    justify-content: center;

    
}


#Helperdiv {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

#scholar-container {
    display: flex;
    flex-direction: column;
    

}

#searchField {

    margin-left: auto;
    width: 100px;     /* Sets the width of the element */
    border-radius: 5px;
}
#searchSpanField {

    border-radius: 5px;
    width: 100px;     /* Sets the width of the element */
}

#SearchCintainer {

}
#SearchCounter{
    bottom: 0px;
}



#InTextCitFrame {
    border: 0px solid #ccc !important;
    overflow-y: auto;
    max-height: 80%;
}

#LeftContainer {
    display: flex;
    z-index: 1000;
    flex-direction: row;
    justify-content: center;
    align-items: center; 
    gap: 10px;

}
#RightContainer {
    display: flex;
    z-index: 1000;
    gap: 5px;
    margin-left: auto;

}

h1 {
  font-size: 2rem;   /* or whatever size fits your design */
  font-weight: bold;
}

h2 {
  font-size: 1.5rem;   /* or whatever size fits your design */
  font-weight: bold;
}

h4 {
  font-size: 1rem;   /* or whatever size fits your design */
  font-weight: bold;
}
/* Style for the menu icon */
.menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: none !important;
    width: 30px !important;
    height: 22px !important;
    cursor: pointer;
    margin-left: auto;
    padding: 0px !important;
}

.menu-icon .bar {
    height: 4px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
}

/* The dropdown menu list */
.menu {
    list-style-type: none;
    padding: 5px;
    background-color: var(--primary-color);
    position: absolute;
    top: 30px; /* This makes the menu appear just below the icon */
    right: 10px;
    display: none; /* Hidden by default */
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Give it a dropdown feel */
}

.menu li {
    margin: 5px 0;
}

.menu a {
    text-decoration: none;
    color: white;
    display: block;
    padding: 10px;
}

.menu a:hover {
    border-radius: 5px;
}

/* Show the menu when active */
.menu.active {
    display: block;
    z-index: 9999;
}

.reload-icon {
    width: 25px;
    height: 25px;
    background-image: url('reload.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    margin-left: auto;
}

.reload-icon:hover {
    transform: rotate(90deg);
}


#Trash1 {
    background-image: url('trash-can.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    width: 20px;
    height: 20px;
    margin-left: auto;
}

.loading-screen {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5); /* White background with 0.5 opacity */
    z-index: 9999; /* High z-index to make sure it overlays everything */
    justify-content: center;
    align-items: center;
    text-align: center;
    
  }
#MainLoading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;    /* Full width */
    height: 100vh;   /* Full height */
    background-color: rgba(255, 255, 255, 0.5); /* Slight overlay (or transparent) */
    z-index: 9999;   /* On top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hide the border/box */
#MainLoading.hidden {
    display: none;
}
:root{
  --usl-bg: #fff;
  --usl-fg: #1b1b1b;
  --usl-muted: #6b7280;
  --usl-primary: #2563eb;       /* brand/primary */
  --usl-primary-weak: #e8f0ff;
  --usl-shadow: 0 24px 48px rgba(0,0,0,.18), 0 12px 24px rgba(0,0,0,.12);
  --usl-radius: 16px;
}

#ModalBackdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
}

#UserSelectLoading {
  display: grid ;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

#UserSelectLoading{
  position: fixed; z-index: 9999;
  top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.98);
  background: var(--usl-bg);
  color: var(--usl-fg);
  width: min(560px, 90vw);
  padding: 24px 24px 20px;
  border-radius: var(--usl-radius);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: var(--usl-shadow);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: center;
  animation: usl-in .14s ease-out both;
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Heading & body */
#UserSelectLoading h2{
  margin: 0;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.2;
  letter-spacing: .2px;
}
#UserSelectLoading p{
  margin: 0;
  color: var(--usl-muted);
  font-size: clamp(14px, 1.9vw, 16px);
}



/* Buttons */
#userSelectButtonCont{
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px;
}
.btn{
  appearance: none; border: 1px solid transparent; border-radius: 10px; 
  padding: 10px 14px; font-weight: 600; cursor: pointer; transition: transform .06s ease, background .12s, box-shadow .12s;
}




.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: var(--usl-primary); color: #fff; 
  box-shadow: 0 8px 16px rgba(37,99,235,.25);
}
.btn-primary:hover{ filter: brightness(1.05); }
.btn-ghost{
  background: #fff; color: var(--usl-fg); border-color: rgba(0,0,0,.12);
}
.btn-ghost:hover{ background: #f7f7f9; }

#UserSelectContinue[disabled]{
  opacity: .55; cursor: not-allowed; box-shadow: none; filter: none;
}

/* Entrance animation */
@keyframes usl-in{
  from{ opacity: 0; transform: translate(-50%,-48%) scale(.96); }
  to  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  #UserSelectLoading{ animation: none; }
}

/* Small screens: stack buttons full-width */
@media (max-width: 420px){
  #userSelectButtonCont{ grid-template-columns: 1fr; }
}






/* Icon badge */
.usl-icon{
  width: 48px; height: 48px; margin: 0 auto 4px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--usl-primary-weak);
  color: var(--usl-primary);
  font-size: 26px; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.12);
}
#userSelectText {
    text-align: center; /* Center text inside this div */
    margin-bottom: 20px;
  }
:root{
  --ui-bg: #f5f6f8;
  --card-bg: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 10px 20px rgba(0,0,0,.06);
  --primary: #2563eb;
  --primary-weak: #e8f0ff;
}

#settings{
  display:none;
  margin: 12px;
  padding: 8px 8px 12px;
  background: var(--ui-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Title */
.settings-title{
  margin: 10px 12px 8px;
  font: 600 18px/1.3 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color: var(--text);
}

/* Cards */
.card{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin: 10px;
}

/* Grid for Start/End cards */
.settings-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 820px){
  .settings-grid{ grid-template-columns: 1fr; }
}

/* Paragraph styling inside cards */
#settings-1 p, #settings-2 p, #settings-3 p, #settings-4 p{
  margin: 0 0 8px 0;
  color: var(--muted);
  font: 14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}
#settings-1 b, #settings-2 b, #settings-3 b, #settings-4 b{
  display:block; margin-bottom: 4px; color: var(--text);
}

/* Checkbox row */
#settings-1 label{
  display:inline-flex; align-items:center; gap:8px;
  margin-right: 14px; margin-top: 6px;
  font-size: 14px; color: var(--text);
}

/* Buttons (shared) */
.btn{
  appearance:none; cursor:pointer;
  border-radius: 10px; border: 1px solid var(--border);
  background:#e4e4e4; color: var(--text);
  padding: 10px 14px; font-weight:600;
  transition: background .12s ease, transform .06s ease, box-shadow .12s ease;
}
/*.btn:hover{ background:#f7f7f9; }*/
.btn:active{ transform: translateY(1px); }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

.btn-primary{
  background: var(--primary-color);
  color:#fff; border-color: var(--primary);
  box-shadow: 0 10px 18px rgba(37,99,235,.22);
}
.btn-primary:hover{ filter: brightness(1.05); }

.btn-ghost{
  background:#fff;
  color: var(--text);
}

/* “Set start/end manually” buttons inside the two cards */
#settings-2 .button, #settings-3 .button{
  /* keep your existing .button class if used elsewhere; give them the new look: */
  composes: btn from none; /* if your build supports it; if not, just add class="btn" in HTML */
}

/* Reference separation toggle buttons */
.toggle-group{
  display:flex; gap:10px; justify-content:center; width:100%;
  margin-top: 6px; margin-bottom: 8px;
}
.toggle-group .btn{
  width: 180px; height: 56px; border-radius: 12px;
  font-weight:700;
}
.toggle-group .btn.is-active{
  background: var(--primary);
  color:#fff; border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(37,99,235,.20);
}

/* Continue button pinned right */
#continue-button {
    background-color: var(--primary-color); /* brighter blue */
    color: rgb(2, 2, 2);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#settings-4 {
    display: flex;
    flex-direction: column;
}
#continue-button:hover {
     /* background-color: #1d4ed8; /* darker blue on hover */
}
#continue-button {
    align-self: flex-end; /* now works */
}
/* Hide mini anchors/images as you did */
a[href="javascript:"]{ display:none; }

/* Keep your tiny picker override */
.citavipicker{ height:3px !important; width:3px !important; }

.custom-tooltip {
  position: absolute;
  z-index: 9999;
  pointer-events: auto;            /* crucial: allow hovering INSIDE the tooltip */
  background: #fff;
  color: #1b1b1b;
  border: 1px solid #dcdce1;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06);
  padding: 10px 12px;
  transition: opacity 120ms ease, visibility 0s linear 120ms; /* hide after fade */
}

.custom-tooltip[style*="opacity: 1"] {
  transition: opacity 120ms ease, visibility 0s; /* show immediately */
}

.spinner2 {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 0, 0, 0.15);  /* light border */
  border-top-color: var(--primary-color, #4a90e2); /* colored part */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 8px auto 0 auto; /* center under the text */
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


#Goback {
    width: 25px;
    height: 25px;
    background-image: url('arrow.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: white;
    cursor: pointer;
}

#Goback2 {
    width: 25px;
    height: 25px;
    background-image: url('arrow.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: white;
    cursor: pointer;
}

.lang-switcher-container {
  position: relative;
  display: inline-block;
}

.lang-icon {
  font-size: 1.5em; /* Adjust size as needed */
  cursor: pointer;
  /* Add any additional styling for your icon here */
  padding: 5px; /* Example padding */
}

/* ... existing CSS for .lang-menu-dropdown and .lang-menu-dropdown li ... */
.lang-switcher-container {
  position: relative;
  display: inline-block;
}



.lang-icon {
  background: none;
  border: none;
  font-size: 1.5em; /* Adjust size as needed */
  cursor: pointer;
    display: flex;
  align-items: center;           /* centers icon vertically in container */
  justify-content: center;       /* centers icon horizontally */
}

.icon_scg{
     display: flex;
  align-items: center;           /* centers icon vertically in container */
  justify-content: center;       /* centers icon horizontally */ 
}

.icon_scg {
  color: white;
}
.icon_scg svg {
  fill: white;
}

#lang-icon {
  display: flex;
  align-items: center;           /* centers icon vertically in container */
  justify-content: center;       /* centers icon horizontally */
  width: 30px;
  height: 22px;
  cursor: pointer;
  margin-left: auto;              /* pushes it to the right end like hamburger */
}



.lang-menu-dropdown {
  display: none; /* Initially hide the dropdown */
  position: absolute;
  right: 0;
  list-style: none;
  padding: 10px;
  margin: 0;
  background-color: var(--primary-color);
  border: 1px solid #ccc;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 10;
}

.lang-menu-dropdown.show {
  display: block; /* Show the dropdown when this class is added */
}

.lang-menu-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
}

.lang-menu-dropdown li:hover {
  background-color: #f0f0f0;
}

#Goback:hover {
    color: #e0e0e0ba; /* Slightly darker gray on hover */
}

#password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 50, 50, 0.9);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    display: none !important;
  }

  #password-input {
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    margin-top: 10px;
  }

  #password-button {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
  }

  #password-error {
    color: red;
    margin-top: 10px;
  }

  #cookie-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none; /* Hidden by default, shown with JS if needed */
  }
  
  #cookie-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5); /* semi-transparent gray */
  }
  
  #cookie-banner {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #333;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    transform: translateY(100%);
    transition: transform 0.5s ease-out;
  }
  
  #cookie-btn {
    margin-left: 10px;
    padding: 5px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
  }
  
  #cookie-container.show #cookie-banner {
    transform: translateY(0);
  }


  /* Blur background when modal is active */
body.modal-open > *:not(#privacy-modal) {
    filter: blur(5px);
    pointer-events: none;
  }
  
  /* Modal container (hidden by default) */
  .modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(2px);
    background-color: rgba(0, 0, 0, 0.3);
    justify-content: center;
    align-items: center;
  }
  
  /* Modal content box */
  .modal-content {
    position: relative; /* Needed to position the X inside */
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 80%;
    max-height: 80vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    overflow-y: auto;
  }
  
  /* Close button INSIDE the modal content */
  .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
  }
  
  .close-btn:hover {
    color: #000;
  }
  
  
  @keyframes slideUp {
    from {
      transform: translateY(50px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  
  

.tt { max-width:380px; font:13px/1.35 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; color:#1b1b1b; }
.tt-status { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.tt-pill { display:inline-block; padding:2px 8px; border-radius:999px; font-weight:600; border:1px solid transparent; }
.tt-pill--found{background:#E7F7EC;border-color:#B5E3C2;}
.tt-pill--ambig{background:#FFF6E5;border-color:#FAD9A6;}
.tt-pill--year{background:#EAF3FF;border-color:#C6DCF9;}
.tt-pill--byAbbr{background:#EEEAFE;border-color:#D5CBFB;}
.tt-pill--typo{background:#FFF1F5;border-color:#FBC2D4;}
.tt-pill--not_found,.tt-pill--not_found_with_suggestions{background:#FCEAEA;border-color:#F3C2C2;}
.tt-pill--invalid{background:#EEE;border-color:#DDD;}
.tt-actions{display:flex;gap:6px;}
.tt-iconbtn{border:0;background:transparent;cursor:pointer;font-size:14px;line-height:1;opacity:.75;}
.tt-iconbtn:hover{opacity:1;}
.tt-line{margin:6px 0 6px;}
.tt-suggestion{margin:2px 0 6px;opacity:.9;font-style:italic;}
.tt-hint{margin:2px 0 8px;opacity:.85;}
.tt-block{margin-top:8px;}
.tt-header{font-weight:600;margin:8px 0 6px;}
.tt-list{list-style:none;margin:0;padding:0;}
.tt-item{display:grid;grid-template-columns:16px 1fr auto;gap:8px;align-items:center;padding:6px;border-radius:8px;cursor:pointer;}
.tt-item:hover{background:#f7f7f8;}
.tt-item.is-selected{background:#eef6ff;outline:1px solid #c6dcf9;}
.tt-choice{width:14px;height:14px;border-radius:999px;border:2px solid #999;display:inline-block;}
.tt-item.is-selected .tt-choice{border-color:#2b6cb0;box-shadow: inset 0 0 0 3px white, 0 0 0 2px #2b6cb0;background:#2b6cb0;}
.tt-text {
  white-space: normal;
  word-break: break-word;
}
.tt-tags{display:flex;gap:6px;justify-self:end;}
.tt-chip{display:inline-block;padding:1px 6px;border-radius:999px;font-size:11px;background:#f1f1f4;}
.tt-btn{padding:6px 10px;border-radius:8px;border:1px solid #d6d6dc;background:white;cursor:pointer;}
.tt-btn:hover{background:#f7f7f8;}
.tt-btn[disabled]{opacity:.5;cursor:not-allowed;}
.tt-btn--primary{background:#2b6cb0;color:#fff;border-color:#2b6cb0;}
.tt-btn--primary:hover{background:#255ea0;}
.tt-btn--inline{background:transparent;border:0;text-decoration:underline;cursor:pointer;padding:0;font-size:12px;}
.tt-footer{margin-top:10px;display:flex;gap:8px;}
.tt-footer--grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;}



/* Inward flash overlay */
.flash-inward::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    circle at center,
    rgba(255,255,255,0) 60%,
    var(--flash-color, var(--accent-color)) 85%,  /* fallback to accent-color */
    rgba(255,0,0,0) 100%
  );
  transform: scale(1.08);
  opacity: 0;
  animation: inwardFlash 800ms ease-out forwards;
}

@keyframes inwardFlash {
  0%   { opacity: 0;   transform: scale(1.12); }
  25%  { opacity: 0.9; transform: scale(1.06); }
  100% { opacity: 0;   transform: scale(1.00); }
}

*{box-sizing:border-box} body{margin:0;line-height:1.6;font-family:system-ui,sans-serif}
img,video{max-width:100%;height:auto;display:block}
/* a,button,input,label{min-height:38px} /* comfy tap targets */
.container{max-width:72rem;margin:0 auto;padding:1rem}


/* phones (portrait) */
@media (max-width: 768px) and (orientation: portrait) {
  html, body {
    height: auto;           /* let page grow */
    overflow-y: auto;         /* allow page scrolling */
  }

  #viewer {
    flex-direction: column; /* stack */
    overflow-y: visible;    /* was hidden → allow scroll */
    align-items: stretch;
  }

  /* kill fixed heights so content can extend the page */
  .frame,
  .intro-frame,
  .OuterFrame {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important; /* remove nested scrollbars */
    margin-bottom: 12px;
    flex: 0 0 auto;
  }
}


.Trash-icon {
  width: 16px;
  height: 16px;
  display: block;
}
