:root {
  --header-height: 4.5rem; /* fallback, will be overwritten by JS */
}

:where([class^="ri-"])::before { content: "\f3c2"; }
body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
}

/* Don't block gestures globally */
body, html {
    touch-action: auto;
  }

  .demo-buttons {
    min-width: 0; /* allow flex child to shrink */
  }
  .demo-buttons button {
    min-width: max-content; /* button itself keeps text intact */
  }

  /* Block browser gestures only inside PDF viewer */
.pdf-viewer, .pdf-container {
    touch-action: none; /* disables browser zoom/pan here */
  }

.pdf-container {
    position: relative;
    overflow: hidden;
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
}
.pdf-viewer {
    width: 100%;
    flex: 1;
    background-color: white;
    position: relative;
    overflow: hidden;
    cursor: grab;
}
.pdf-viewer.dragging {
    cursor: grabbing;
}
.pdf-viewer.draw-mode {
    cursor: crosshair;
}
.pdf-canvas-container {
    position: absolute;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
    touch-action: none;
}
.selection-rect {
    position: absolute;
    border: 2px solid #4f46e5;
    background-color: rgba(79, 70, 229, 0.1);
    pointer-events: none;
}
.drawing-active {
    cursor: crosshair;
}
.ad-container {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
}
.ad-container.hidden {
    display: none !important;
}
input[type="file"] {
    display: none;
}
.table-container {
    height: calc(100% - 2rem);
    overflow: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    background-color: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 10;
}
th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
tr:hover {
    background-color: #f8fafc;
}
.divider {
    width: 8px;
    background-color: #f1f5f9;
    cursor: col-resize;
}
.tool-btn.active {
    background-color: #4f46e5;
    color: white;
}
#coordinate-labels {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.875rem;
    color: #475569;
}
.coordinate-item {
    display: inline-flex;
    align-items: center;
    margin: 0 1rem;
    padding: 0.25rem 0.5rem;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}
.coordinate-label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: #64748b;
}
.coordinate-value {
    font-family: 'Consolas', monospace;
    color: #0f172a;
    min-width: 3rem;
    text-align: right;
}
.word-highlight {
    z-index: 1000;
    transition: all 0.2s ease-in-out;
}
tr:hover {
    background-color: #f8fafc;
}
.container > div {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.selected-row {
    background-color: #e0e7ff !important; /* Tailwind's bg-indigo-100 */
}
.drag-handle {
    touch-action: none;   /* prevent accidental scrolling when grabbing */
    padding: 0.25rem;
  }

  .demo-btn-selected {
    background-color: #4f46e5;
    color: white;
  }
  
/* Hide number input spinners for edit fields */
input[type=number].edit-min-tol::-webkit-inner-spin-button,
input[type=number].edit-min-tol::-webkit-outer-spin-button,
input[type=number].edit-max-tol::-webkit-inner-spin-button,
input[type=number].edit-max-tol::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number].edit-min-tol,
input[type=number].edit-max-tol {
    -moz-appearance: textfield;
}
/* Remove spinners for custom min/max tolerance fields */
input[type=number]#custom-min-tolerance::-webkit-inner-spin-button,
input[type=number]#custom-min-tolerance::-webkit-outer-spin-button,
input[type=number]#custom-max-tolerance::-webkit-inner-spin-button,
input[type=number]#custom-max-tolerance::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number]#custom-min-tolerance,
input[type=number]#custom-max-tolerance {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Ensure the main content flex wrapper fills viewport under header */
/* .full-viewport-height {
    height: calc(100vh - var(--header-height)) !important;
} */

/* Prevent child panels from collapsing and allow internal scrolling */
/* .main-content-container {
    min-height: calc(100vh - var(--header-height));
}
.main-content-container > div {
    min-height: 0; 
} */

/* Force-hide ads for Pro users across refresh and late script injections */
body.pro .ad-container {
    display: none !important;
}

@media (max-width: 640px) {
    #auth-modal > div {
      width: 100%;
      height: 100%;
      max-width: none;
      border-radius: 0;
    }
  }