/* === FONT & THEME VARIABLES === */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hue-primary: 240; /* Indigo */
  --hue-secondary: 280; /* Magenta/Purple */
  --hue-danger: 350;  /* Red */
  --header-height: auto; /* Allow header to grow */
  --header-min-height: 65px;

  /* Light Mode */
  --bg-main: #f8f9fc;
  --bg-glass: rgba(255, 255, 255, 0.5);
  --bg-card: #ffffff;
  --bg-subtle: #f1f3f8;
  --border: rgba(0, 0, 0, 0.08);
  --text-primary: #1a202c;
  --text-secondary: #5a677d;
  --shadow-color: 220, 40%, 50%;
  --primary: hsl(var(--hue-primary), 90%, 65%);
  --primary-dark: hsl(var(--hue-primary), 90%, 55%);
  --danger: hsl(var(--hue-danger), 80%, 55%);
  --grad-1: hsl(var(--hue-primary), 100%, 85%);
  --grad-2: hsl(var(--hue-secondary), 100%, 90%);
}

.dark-mode {
  --bg-main: #131824;
  --bg-glass: rgba(28, 35, 51, 0.5);
  --bg-card: #1c2333;
  --bg-subtle: #2a3346;
  --border: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f4f9;
  --text-secondary: #a0aec0;
  --shadow-color: 220, 40%, 0%;
  --primary: hsl(var(--hue-primary), 80%, 70%);
  --primary-dark: hsl(var(--hue-primary), 80%, 80%);
  --danger: hsl(var(--hue-danger), 70%, 60%);
  --grad-1: hsl(var(--hue-primary), 80%, 20%);
  --grad-2: hsl(var(--hue-secondary), 80%, 25%);
}


/* === BASE & LAYOUT === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: background-color 0.3s;
  font-size: 16px;
  overflow: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
body::before, body::after {
  content: ''; position: fixed; z-index: -1;
  border-radius: 50%; filter: blur(150px);
  transition: background-color 0.5s;
}
body::before { width: 500px; height: 500px; background: var(--grad-1); top: -20%; left: -10%; animation: pulse 15s infinite alternate; }
body::after { width: 600px; height: 600px; background: var(--grad-2); bottom: -25%; right: -15%; animation: pulse 20s infinite alternate-reverse; }
@keyframes pulse { from { transform: scale(0.8); } to { transform: scale(1.2); } }

.app-layout { display: flex; height: 100vh; }

/* === PWA Install Prompt Banner === */
#install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.2);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s, transform 0.3s;
}
#install-prompt.hidden {
    opacity: 0;
    transform: translate(-50%, 100px);
    pointer-events: none;
}
#install-prompt p {
    margin: 0;
    font-weight: 500;
}
#install-prompt-btn.primary {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
#install-prompt-btn.primary:hover {
    background-color: var(--primary-dark);
}
#install-dismiss-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

/* === SIDEBAR === */
.sidebar {
  width: 240px;
  background-color: var(--bg-glass);
  backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; flex-direction: column; height: 100vh;
  box-shadow: inset -1px 0 0 var(--border);
  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 20;
}
.sidebar-content { overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.sidebar-header { margin-bottom: 2rem; }
.sidebar h1 { font-size: 1.3rem; font-weight: 600; }
.action-section { margin-bottom: 2rem; }
.action-section h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 0.75rem; font-weight: 600; }
.sidebar-btn { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem; margin-bottom: 0.5rem; font-size: 0.95rem; font-weight: 500; text-align: left; border: 1px solid transparent; border-radius: 8px; background-color: rgba(128,128,128,0.1); color: var(--text-primary); cursor: pointer; transition: all 0.2s; }
.sidebar-btn:hover { border-color: var(--primary); color: var(--primary); background-color: var(--bg-subtle); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(var(--shadow-color), 0.1); }
.sidebar-btn:disabled { opacity: 0.6; cursor: not-allowed; background-color: transparent; border-color: var(--border); color: var(--text-secondary); transform: none; box-shadow: none; }
.sidebar-btn.primary { background-color: var(--primary); color: white; border-color: var(--primary); }
.sidebar-btn.primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.sidebar-btn i { font-size: 1.1rem; width: 20px; text-align: center; }
a.sidebar-btn { text-decoration: none; }
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  min-width: 0;
}
.main-header {
  height: var(--header-height);
  min-height: var(--header-min-height);
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; 
  align-items: center;
  flex-shrink: 0; background-color: var(--bg-glass);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: inset 0 -1px 0 var(--border);
  position: fixed; top: 0; left: 240px; right: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 1rem;
}
.header-right { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    margin-left: auto;
}
#history-controls { display: flex; align-items: center; gap: 0.5rem; }
.pages-grid-container {
  flex-grow: 1;
  overflow: auto;
  padding: 1.5rem;
  padding-top: calc(var(--header-min-height) + 1.5rem);
}

/* === INITIAL PLACEHOLDER === */
#initial-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
  user-select: none;
}
#initial-placeholder i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}
#initial-placeholder h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* === MINIMAL SCROLLBAR STYLES === */
.pages-grid-container, .sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-subtle);
}
.pages-grid-container::-webkit-scrollbar, .sidebar-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.pages-grid-container::-webkit-scrollbar-track, .sidebar-content::-webkit-scrollbar-track {
    background: var(--bg-subtle);
}
.pages-grid-container::-webkit-scrollbar-thumb, .sidebar-content::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
    border: 2px solid var(--bg-subtle);
}


/* === EDITOR-SPECIFIC STYLES === */
.hidden { display: none !important; }

/* Tool Palette in Sidebar */
.tool-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 0.5rem; }
.tool-btn { background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-secondary); width: 100%; height: 40px; border-radius: 8px; cursor: pointer; font-size: 1rem; transition: all 0.2s; position: relative; }
.tool-btn:hover { background-color: var(--primary); color: white; border-color: var(--primary); transform: translateY(-2px); }
.tool-btn.active { background-color: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 0 10px rgba(var(--shadow-color), 0.2); }

/* Contextual Tools in Header */
#contextual-tools-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    flex-wrap: wrap; 
}
.context-options { display: flex; align-items: center; gap: 0.5rem; }
.context-options span, .context-options label { font-size: 0.9rem; color: var(--text-secondary); white-space: nowrap; }
.context-options select, .context-options input, .tool-option-btn {
    height: 36px; border-radius: 6px; border: 1px solid var(--border);
    background-color: var(--bg-card); color: var(--text-primary);
    font-family: var(--font-family); font-size: 0.9rem;
    padding: 0 0.5rem;
}
#font-size-input, #shape-stroke-width, #table-stroke-width { width: 70px; }
.context-options input[type="color"] { padding: 2px; width: 36px; }
.context-options input[type="range"] { padding: 0; width: 100px; }
.context-options input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.context-options label.context-options { display: flex; align-items: center; gap: 0.25rem; cursor: pointer; }
.context-options label[for="text-blur-slider"], .context-options label[for="shape-blur-slider"], .context-options label[for="table-blur-slider"] { cursor: default; }
.tool-option-btn { cursor: pointer; transition: all 0.2s; padding: 0 0.75rem; }
.tool-option-btn:hover { border-color: var(--primary); color: var(--primary); }
.tool-option-btn.active { background-color: var(--primary); color: white; border-color: var(--primary); }
.tool-option-btn.danger:hover { background-color: var(--danger); color: white; border-color: var(--danger); }
.tool-option-btn.primary { background-color: var(--primary); color: white; border-color: var(--primary); }
.tool-option-btn.primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.tool-option-btn:disabled { opacity: 0.5; cursor: not-allowed; background-color: var(--bg-subtle); border-color: var(--border); color: var(--text-secondary); }
.separator { color: var(--border); font-size: 1.5rem; }
.tool-option-group { display: flex; background-color: var(--bg-subtle); border-radius: 6px; padding: 2px; }
.tool-option-group .tool-option-btn { background: none; border: none; height: 32px; padding: 0 8px; }
.tool-option-group .tool-option-btn.active { background-color: var(--bg-card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Custom Font Dropdown Styles */
.custom-select-container {
    position: relative;
    width: 180px;
}
.custom-select-value {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0 0.75rem;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 4px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(var(--shadow-color), 0.1);
}
.custom-select-group {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.custom-select-option {
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.custom-select-option:hover {
    background-color: var(--bg-subtle);
    color: var(--primary);
}

/* Watermark Radio Group */
.radio-group { display: flex; background-color: var(--bg-subtle); border-radius: 6px; padding: 4px; }
.radio-group input[type="radio"] { display: none; }
.radio-group label { padding: 6px 12px; border-radius: 4px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
.radio-group input[type="radio"]:checked + label { background-color: var(--bg-card); color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
#watermark-text-controls, #watermark-image-controls { display: flex; align-items: center; gap: 0.5rem; }
#watermark-text-input { flex-grow: 1; }


/* Page & Zoom Controls in Header */
#page-controls, #zoom-controls { display: flex; align-items: center; background-color: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
#page-controls button, #zoom-controls button { background: none; border: none; color: var(--text-secondary); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
#page-controls button:hover, #zoom-controls button:hover { background-color: var(--bg-subtle); color: var(--primary); }
#page-indicator, #zoom-level { padding: 0 0.75rem; font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }

/* PDF Viewer */
#pdf-viewer-container { padding: 20px; width: fit-content; margin: 0 auto; }
#pdf-viewer { position: relative; box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.1); }
#pdf-viewer.brush-tool-active, #pdf-viewer.clone-tool-active, #pdf-viewer.eraser-tool-active, #pdf-viewer.image-eraser-active { cursor: none; }
#pdf-viewer.text-tool-active { cursor: text; }
#pdf-viewer.shape-tool-active, #pdf-viewer.table-tool-active { cursor: crosshair; }
#pdf-viewer.clone-tool-alt-active { cursor: crosshair; }
#pdf-viewer.eyedropper-active { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16.27 7.73L6.5 17.5l-4-4L12.27 3.73a2.12 2.12 0 0 1 3 3zM8.5 14.5L5 11"/></svg>') 4 19, crosshair; }

#pdf-viewer.eyedropper-active .object-wrapper,
#pdf-viewer.eyedropper-active .object-wrapper img {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16.27 7.73L6.5 17.5l-4-4L12.27 3.73a2.12 2.12 0 0 1 3 3zM8.5 14.5L5 11"/></svg>') 4 19, crosshair !important;
}

.text-tool-active .object-wrapper,
.text-tool-active .object-wrapper .text-box {
    cursor: text;
}

/* Canvas layers */
#pdf-canvas, #background-canvas, #drawing-canvas, #text-layer, #shape-canvas {
  position: absolute;
  top: 0;
  left: 0;
}
#pdf-canvas { z-index: 1; }
#background-canvas { z-index: 2; pointer-events: none; }
#shape-canvas { z-index: 3; pointer-events: none; }
#drawing-canvas { z-index: 4; pointer-events: none; }
#text-layer { z-index: 5; pointer-events: auto; }

/* Objects */
.object-wrapper { position: absolute; cursor: move; border: 1px solid transparent; user-select: none; transition: opacity 0.2s; }
.object-wrapper:hover, .object-wrapper.selected { border: 1px dashed var(--primary); }
.object-wrapper:hover .resizer, .object-wrapper:hover .rotater,
.object-wrapper.selected .resizer, .object-wrapper.selected .rotater { display: block; }

.text-box { 
    padding: 2px; 
    white-space: pre-wrap; 
    word-break: break-word; 
    min-width: 20px; 
    min-height: 20px; 
    box-sizing: border-box; 
    outline: none; 
    user-select: text; 
    line-height: 1.2; 
}
.text-box.underlined { text-decoration: underline; }
.image-box { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.resizer, .rotater { position: absolute; width: 10px; height: 10px; background-color: white; border: 1px solid var(--primary); border-radius: 50%; display: none; z-index: 10; }
.resizer.top-left { top: -5px; left: -5px; cursor: nwse-resize; }
.resizer.top-right { top: -5px; right: -5px; cursor: nesw-resize; }
.resizer.bottom-left { bottom: -5px; left: -5px; cursor: nesw-resize; }
.resizer.bottom-right { bottom: -5px; right: -5px; cursor: nwse-resize; }
.rotater { top: -20px; left: 50%; transform: translateX(-50%); cursor: grabbing; }

.resizer.top { top: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resizer.bottom { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resizer.left { left: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.resizer.right { right: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.font-resizer { display: none !important; }


/* Table Styles */
.table-container {
    display: grid;
    width: 100%;
    height: 100%;
    border-top: var(--table-border-width, 1px) solid var(--table-border-color, var(--border));
    border-left: var(--table-border-width, 1px) solid var(--table-border-color, var(--border));
    position: relative;
}
.table-cell {
    border-right: var(--table-border-width, 1px) solid var(--table-border-color, var(--border));
    border-bottom: var(--table-border-width, 1px) solid var(--table-border-color, var(--border));
    padding: 4px;
    min-width: 30px;
    outline: none;
    user-select: text;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: inherit;
    color: inherit;
}
.table-cell:focus {
    background-color: hsla(var(--hue-primary), 90%, 65%, 0.1);
    outline: 1px solid var(--primary);
    z-index: 1;
    position: relative;
}

/* Table Resizers */
.table-col-resizer, .table-row-resizer {
    position: absolute;
    background-color: transparent;
    z-index: 5;
    transition: background-color 0.2s;
}
.table-col-resizer {
    top: 0;
    height: 100%;
    width: 10px;
    cursor: col-resize;
    transform: translateX(-5px);
}
.table-row-resizer {
    left: 0;
    width: 100%;
    height: 10px;
    cursor: row-resize;
    transform: translateY(-5px);
}

/* OCR box & cursors */
#ocr-selection-box { position: absolute; border: 2px dashed var(--primary); background-color: hsla(var(--hue-primary), 90%, 65%, 0.2); z-index: 5; pointer-events: none; display: none; }
#brush-cursor { position: absolute; border: 1px solid #333; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; display: none; z-index: 100; }
#clone-source-indicator { position: absolute; width: 10px; height: 10px; border: 1px solid black; background: white; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; display: none; z-index: 101; }

/* Crop UI */
#crop-box-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 50; }
.crop-box-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.crop-box { position: absolute; border: 2px dashed #fff; cursor: move; }
.crop-handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 1px solid #333; border-radius: 50%; }
.crop-handle.top-left { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle.top-right { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle.bottom-left { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle.bottom-right { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-actions { position: absolute; bottom: -45px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.crop-actions button { width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; font-size: 1rem; color: white; transition: all 0.2s; }
#confirm-crop-btn { background-color: var(--primary); }
#confirm-crop-btn:hover { background-color: var(--primary-dark); }
#cancel-crop-btn { background-color: var(--danger); }
#cancel-crop-btn:hover { background-color: hsl(var(--hue-danger), 70%, 45%); }

/* Layers Panel */
#layers-panel {
  position: fixed;
  top: calc(var(--header-min-height) + 20px);
  right: 20px;
  width: 250px; max-height: 400px;
  background-color: var(--bg-card);
  box-shadow: 0 8px 25px rgba(var(--shadow-color), 0.15);
  border-radius: 12px; z-index: 15;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.layers-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.layers-panel-header h3 { font-size: 1rem; margin: 0; }
#close-layers-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); padding: 0 5px; }
#layers-list { overflow-y: auto; flex-grow: 1; padding: 0.5rem; }
.layer-item { padding: 0.5rem 0.75rem; font-size: 0.9rem; border-radius: 6px; cursor: grab; user-select: none; background-color: transparent; transition: background-color 0.2s; display: flex; flex-direction: column; gap: 8px; }
.layer-item:hover { background-color: var(--bg-subtle); }
.layer-item.dragging { opacity: 0.5; background-color: var(--primary); color: white; }
.layer-info { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.layer-name { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.layer-visibility-toggle, .layer-delete-btn { cursor: pointer; color: var(--text-secondary); }
.layer-visibility-toggle:hover { color: var(--primary); }
.layer-delete-btn:hover { color: var(--danger); }
.layer-item.hidden-layer .layer-name { opacity: 0.6; text-decoration: line-through; }
.layer-item.hidden-layer .layer-visibility-toggle { color: var(--border); }
.layer-opacity-slider { width: 100%; margin-top: 4px; }
input[type="range"].layer-opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  outline: none;
  border-radius: 5px;
}
input[type="range"].layer-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  background: var(--primary);
  cursor: pointer;
  border-radius: 50%;
}
input[type="range"].layer-opacity-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: var(--primary);
  cursor: pointer;
  border-radius: 50%;
  border: none;
}

/* Loader */
#loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(10px) saturate(150%); display: flex; align-items: center; justify-content: center; z-index: 1100; }
.loader-content { background: var(--bg-card); padding: 2rem 3rem; border-radius: 12px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.loader-content i { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }
.loader-content p { font-size: 1.1rem; font-weight: 500; color: var(--text-primary); }

/* Password overlay */
#password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px) saturate(150%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.password-prompt {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.2);
  max-width: 400px;
  width: 90%;
  position: relative;
}
.password-prompt h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.password-prompt p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
#unlock-now-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s;
}
#unlock-now-btn:hover {
  background-color: var(--primary-dark);
}
#close-password-prompt-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0 8px;
  line-height: 1;
}

/* Mobile unsupported overlay */
#mobile-unsupported-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.mobile-unsupported-content { max-width: 400px; }
.mobile-unsupported-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.mobile-unsupported-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
@media (max-width: 768px) {
    #mobile-unsupported-overlay { display: flex; }
    .app-layout { display: none; }
}