/* =========================================================
   Root & Global
   ========================================================= */
:root{
  --clr-primary   : #3b82f6;
  --clr-secondary : #4ade80;
  --clr-accent    : #f472b6;
  --clr-bg-hero   : linear-gradient(135deg,#4f46e5 0%,#3b82f6 35%,#06b6d4 100%);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family:'Poppins',system-ui,sans-serif;
  margin:0;
  background:#f8fafc;               /* neutral backdrop for results page */
  color:#1f2937;
}
h1,h2,h3{margin:.5rem 0;font-weight:600}

/* =========================================================
   HERO (upload page only)
   ========================================================= */
.hero{
  position:relative;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem;
  overflow:hidden;
  background:var(--clr-bg-hero);
  color:#fff;
  isolation:isolate;                /* blobs sit behind card */
}

/* floating blobs */
.hero-bg{position:absolute;inset:0;overflow:hidden;z-index:0}
.blob{
  position:absolute;border-radius:50%;opacity:.35;filter:blur(60px);
  animation:float 14s ease-in-out infinite;
}
.b1{width:480px;height:480px;background:var(--clr-secondary);top:-80px;left:-100px}
.b2{width:360px;height:360px;background:var(--clr-accent);bottom:-120px;right:-80px;animation-delay:-4s}
.b3{width:260px;height:260px;background:#facc15;top:50%;left:60%;animation-delay:-8s}
@keyframes float{50%{transform:translateY(-50px) scale(1.05)}}

/* glassy upload card */
.upload-card{
  width:100%;
  max-width:520px;
  padding:2.5rem 2.75rem;
  border-radius:24px;
  background:rgba(255,255,255,.15);
  backdrop-filter:blur(16px) saturate(120%);
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  text-align:center;
  z-index:1;
}
.upload-card h1{font-size:2rem;margin-bottom:.25rem}
.tagline{font-size:1rem;font-weight:400;margin-bottom:1.5rem;opacity:.9}

/* ------------ Drop-zone ------------ */
.dropzone{
  border:2.5px dashed rgba(255,255,255,.6);
  padding:2.5rem 1.5rem;
  border-radius:16px;
  transition:border-color .3s,background .3s;
  margin-bottom:1rem;
  cursor:pointer;
}
.dropzone p{margin:0;font-size:.95rem}
.dropzone.dragover{
  border-color:#fff;
  background:rgba(255,255,255,.15);
}
.dropzone.disabled{opacity:.45;pointer-events:none}

/* chosen-file pill - push remove button to right edge */
.selected {
  background: rgba(0,0,0,.15);
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .9rem;
  font-size: .9rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
}

/* Ensure filename starts from left edge */
#selectedFileName {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: .6rem;
  text-align: left; /* Ensure text starts from the left */
  padding-left: 0;  /* Remove any potential padding */
}

/* Keep button fixed on right */
#removeFileBtn {
  background: none;
  border: none;
  color: #fee2e2;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0 0 .3rem;
  flex-shrink: 0; /* Prevent button from shrinking */
}

/* ------------ Picker & Buttons ------------ */
.picker-label{
  display: block;
  margin: .75rem 0 .25rem;
  font-size: .9rem;
  font-weight: 500;
  text-align: left;
  color: #e0e7ff;
}
.picker{
  width:100%;padding:.55rem .75rem;border-radius:10px;border:none;
  font-size:.95rem;background:rgba(255,255,255,.85);color:#111;
  margin-bottom:1.25rem;
}

.btn-primary{
  width:100%;padding:.75rem 1rem;border:none;border-radius:12px;
  font-size:1.05rem;font-weight:600;cursor:pointer;color:#fff;
  background:#111827;transition:background .25s,transform .15s;
}
.btn-primary:hover:not(:disabled){background:#0f172a}
.btn-primary:active:not(:disabled){transform:scale(.97)}
button:disabled{opacity:.45;cursor:not-allowed}

.text-btn{
  background:none;border:none;color:#fff;font-weight:600;
  cursor:pointer;text-decoration:underline dotted;
}
.text-btn:hover{color:#e0e7ff}

/* spinner (white for hero) */
.spinner{
  width:32px;height:32px;
  border:4px solid rgba(255,255,255,.25);
  border-top-color:#fff;
  border-radius:50%;
  animation:spin 1s linear infinite;
  margin:1rem auto 0;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* =========================================================
   EVERYTHING BELOW – original styles (results page/shared)
   ========================================================= */
.hidden{display:none}

/* ---------- Two-pane layout ---------- */
.pane-container{display:flex;gap:1rem;flex-wrap:wrap}
.pane{flex:1 1 400px;min-width:300px;display:flex;flex-direction:column}
.pane h3{margin-bottom:.5rem}

/* ---------- Buttons (results page) ---------- */
.paid{
  background:var(--clr-primary);
  color:#fff;
  border:none;
  padding:.6rem 1rem;
  margin-top:1rem;
  cursor:pointer;
  border-radius:6px;
}

/* ---------- Improved-draft column ---------- */
#improvedText{
  max-height:80vh;
  overflow:auto;
  white-space:pre-wrap;
  margin:0;
}

/* highlight marks */
.improved-box mark.red    {background:#fecaca}
.improved-box mark.yellow {background:#fef9c3}
.improved-box mark.green  {background:#dcfce7}

/* ---------- Selected-file pill (legacy on results) ---------- */
#selectedFileDisplay{display:flex;align-items:center;gap:.5rem;margin-top:.5rem}
#selectedFileDisplay.hidden{display:none}

/* ---------- PDF viewer ---------- */
.pdf-scroll{max-height:80vh;overflow:auto}
.pdf-scroll canvas{display:block;margin-bottom:12px;width:100%;height:auto}
#pdfOriginal {
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  background: white;
  padding: 12px;
  
  overflow: hidden auto; /* horizontal:hidden, vertical:auto */
  position: relative; /* for absolute positioning of canvas */
}

/* Ensure canvas elements fit properly */
#pdfOriginal canvas {
  display: block;
  margin-bottom: 12px;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* =========================================================
   Results info boxes (section cards)
   ========================================================= */
.info-container{
  width:100%;
  max-width:600px;
  margin:0 0 1rem 0;
  background:#fafafa;
  border-radius:12px;
  box-shadow:0 4px 8px rgba(0,0,0,.06);
  color:#333;
  font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
  overflow: hidden;  /* Ensures content doesn't overflow rounded corners */
}
.info-container .section{padding:1rem 0}

/* Main title text */
.info-container .main-title{
  font-size:1.8rem;font-weight:700;margin:0;padding:0;flex:1;
}
/* Sub-section headers */
.info-container .section-title{
  font-size:1.4rem;font-weight:600;margin:0 0 .5rem 0;padding-bottom:.25rem;
}
/* Divider between subsections */
.info-container .separator{
  border-top:1.5px solid #ccc;margin-top:1rem;
}
/* Bulleted lists */
.info-container ul{margin:0;padding-left:1.25rem}
.info-container ul li{margin-bottom:.4rem;line-height:1.4}

/* Responsive tweaks */
@media (max-width:480px){
  .info-container{padding:1rem}
  .info-container .main-title  {font-size:1.5rem}
  .info-container .section-title{font-size:1.2rem}
}

/* =========================================================
   Circular score badge
   ========================================================= */
.score-label{position:relative;width:120px;height:120px;margin:0 auto}
.score-label.small{width:60px;height:60px;margin:0}
.score-label.small .score-text{font-size:1.2rem}
.score-label svg{
  width:100%;height:100%;display:block;
  transform:rotate(90deg);transform-origin:50% 50%;
}
.circle-bg{fill:none;stroke:#eee;stroke-width:10}
.circle-progress{
  fill:none;stroke:#007bff;stroke-width:10;stroke-linecap:round;
  transition:stroke-dashoffset .8s ease-out;
}
.score-text{
  position:absolute;top:50%;left:50%;
  transform:translate(-50%,-50%);
  font:700 2rem/1 'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
  color:#007bff;
}

/* =========================================================
   Collapsible header/body
   ========================================================= */
.section-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  cursor: pointer;
  user-select: none;
  background:#fff;
  border-bottom: 1.5px solid #ccc;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.section-header .main-title{
  flex: 1;  
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

/* arrow toggle */
.toggle-btn{
  font-size:1.6rem;background:none;border:none;color:#007bff;
  width:32px;height:32px;display:flex;align-items:center;justify-content:center;
  transition:transform .3s ease;
}
.toggle-btn.expanded{transform:rotate(180deg)}

/* collapsible body */
.section-content{
  overflow:hidden;max-height:0;padding:0 1.5rem;
  background:#fafafa;transition:max-height .4s ease,padding .3s ease;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.section-content.expanded{
  max-height:2000px;           /* big enough */
  padding-top:1rem;padding-bottom:1.5rem;
}

/* =========================================================
   Legacy helper (header-with-score)
   ========================================================= */
.header-with-score{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  width:100%;position:relative;padding-bottom:1.2rem;margin-bottom:.5rem;
}
.header-with-score::after{
  content:'';position:absolute;bottom:0;left:0;height:2px;width:100%;
  background:#007bff;
}

/* ensure improved text wraps inside cards */
#improvedText,#improvedText *{white-space:normal}




/* Add left padding to the results view */
#results-view {
  position: relative;
  min-height: 100vh;
  height: auto;
  padding-left: 2rem; /* Adds space on the left edge */
  padding-right: 2rem;
  padding-bottom: 2rem;
  background: var(--clr-bg-hero); /* Background color gradient for results view */
  color: #fff; /* Keeps the text readable */
  isolation: isolate; /* Keeps blobs behind content */
  overflow: hidden;   /* Contains the blobs */
}

/* keep cards easy to read against the darker background */
#results-view .info-container{
  background:#fff;      /* or #fafafa */
  color:#333;
}

/* Maintain proper spacing within panes */
.pane-container {
  padding-right: 2rem; /* Balance the padding on the right side */
}

/* For smaller screens, adjust padding to be responsive */
@media (max-width: 768px) {
  #results-view {
    padding-left: 1rem; 
  }
  
  .pane-container {
    padding-right: 1rem;
  }
}

/* Adjust blob positions for results view */
#results-view .b1 {
  width: 550px;
  height: 550px;
  top: -180px;
  left: -150px;
}

#results-view .b2 {
  width: 400px;
  height: 400px;
  bottom: -150px;
  right: -100px;
}

#results-view .b3 {
  width: 300px;
  height: 300px;
  top: 70%;
  left: 65%;
}

/* 1 — keep blobs purely decorative (they can’t eat clicks anymore) */
.hero-bg{
  z-index:-1;          /* sits behind everything else            */
  pointer-events:none; /* let mouse / touch events pass through  */
}

/* 2 — allow the page to scroll again while still clipping blobs
      that poke out to the left / right                         */
#results-view{
  overflow-x:hidden;   /* only clip sideways overflow            */
  overflow-y:auto;     /* but allow vertical scrolling           */
}

/* 3 — make sure cards are definitely above the blobs            */
.info-container{
  position:relative;   /* creates its own stacking context       */
  z-index:1;           /* higher than the –1 blobs               */
}


/* =========================================================
   RESULTS VIEW ⇢ glassy “card” aesthetic (matches hero)
   ========================================================= */
#results-view .info-container{
  /* glass effect */
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.35);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);   /* light depth */
  color: #1f2937;                  /* keep dark body copy for legibility */
}

/* let the glass show through */
#results-view .info-container .section-header{
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,.35);
}
#results-view .info-container .section-content{
  background: transparent;
}

/* vivid header + controls */
#results-view .info-container .main-title { color:#fff; }
#results-view .info-container .toggle-btn{ color: var(--clr-primary); }

/* subtle separators so they don’t look “cut-out” on glass */
#results-view .info-container .separator{
  border-top: 1px solid rgba(255,255,255,.35);
}

/* score badge tweaks for dark/light harmony */
#results-view .info-container .circle-bg  { stroke: rgba(255,255,255,.45); }
#results-view .info-container .score-text { color:#fff; }

/* (optional) mark highlights: keep contrast with new glass theme */
#results-view .info-container mark.red,
#results-view .info-container mark.yellow,
#results-view .info-container mark.green{
  color:#0f172a;                   /* dark text inside the highlight */
  font-weight:600;
}


/* =========================================================
   PDF Editing Visuals
   ========================================================= */



/* Floating Save / Cancel bar (now ABOVE the PDF) */
.edit-controls{
  position:absolute;           /* anchored by JS to bottom:100% */
  display:flex;
  gap:.8rem;
  z-index:40;
}
.edit-controls.hidden{display:none}

/* Glassy buttons */
.edit-controls button{
  padding:.55rem 1.25rem;
  border-radius:10px;
  font:600 .95rem/1 "Poppins",sans-serif;
  cursor:pointer;
  border:1px solid rgba(255,255,255,.45);
  background:rgba(255,255,255,.20);
  color:#ffffff;
  backdrop-filter:blur(20px) saturate(160%);
  -webkit-backdrop-filter:blur(20px) saturate(160%);
  box-shadow:0 3px 10px rgba(0,0,0,.18);
  transition:transform .15s ease, box-shadow .15s ease;
}
.edit-controls button:hover  {transform:scale(1.07);}
.edit-controls button:active {transform:scale(.94);}

/* Accent tints so users can tell them apart instantly */
.edit-save   {background:rgba(0, 255, 94, 0.3);}  /* greenish */
.edit-cancel {background:rgba(255, 0, 0, 0.35);} /* reddish  */

.edit-controls button.edit-save   {background:rgba(74,222,128,.80); color: #050404}
.edit-controls button.edit-cancel{background:rgba(248,113,113,.80); color:#050404;}



/* 1 ─ Center the bar & keep it above other content */
.pane { position: relative; }                 /* establish containing block */

.edit-controls   { position:absolute; top:4px; left:50%;
                   transform:translateX(-50%); }

/* 2 ─ Dim everything except the PDF & the bar */
#results-view.editing-active::before{
  content:'';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  pointer-events:none;
  z-index: 30;                                /* sits below controls/PDF   */
}

/* Lift the PDF column itself above the dimmer */
#results-view.editing-active .pdf-scroll{
  position: relative;
  z-index: 50;
}

/* =========================================================
   New Draft Button (results view) - Enhanced
   ========================================================= */
.generate-draft-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  
  /* Rich gradient background instead of flat color */
  background: linear-gradient(135deg, var(--clr-primary) 0%, #2563eb 100%);
  
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  z-index: 100;
  
  /* Enhanced shadow */
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  
  /* Smooth transitions for all properties */
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.2s ease,
              background 0.3s ease;
              
  /* Add a subtle text shadow */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Grow on hover with enhanced shadow */
.generate-draft-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Push down effect when clicked */
.generate-draft-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}


#results-view.editing-active,
#draftDimmer { overscroll-behavior: contain; }

/* =========================================================
   Draft overlay
   ========================================================= */
#draftDimmer{
  position:fixed;inset:0;
  background:rgba(0,0,0,.45);      /* softer dim */
  backdrop-filter:blur(4px);
  display:flex;align-items:center;justify-content:center;
  z-index:300;
}

.draft-sheet{
  width:min(90vw,816px);           /* keep full-page from happening */
  height:min(90vh,1056px);
  background:#fff;
  border-radius:16px;              /* rounded corners */
  padding:2rem;
  overflow:auto;                   /* scrollable */
  box-shadow:0 8px 30px rgba(0,0,0,.25);
}

/* =========================================================
   Full-page spinner overlay (draft generation)
   ========================================================= */
#draftLoading{
  position:fixed;inset:0;
  background:rgba(0,0,0,.35);
  backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;
  z-index:250;                     /* below #draftDimmer (300) */
}
#draftLoading .spinner{
  width:48px;height:48px;          /* a bit larger */
  border-width:6px;
  border-color:rgba(255,255,255,.25);
  border-top-color:#fff;
}

/* Stylish close button for draft view */
.draft-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
  z-index: 100;
}

.draft-close-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #334155;
  transform: scale(1.05);
}

.draft-close-btn:active {
  transform: scale(0.95);
}

/* Make sure the draft sheet has proper positioning for the button */
.draft-sheet {
  position: relative;
  /* your existing styles */
} 

/* ──────────────────────────────────────────────────────────
   Floating ✕ button that lives *above* the dimmer
   ────────────────────────────────────────────────────────── */
#draftCloseBtn{
  position:fixed;
  top:22px;           /* fine-tuned to avoid OS bars */
  left:22px;
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  background:linear-gradient(135deg,#f87171 0%,#ef4444 100%);
  color:#fff;
  box-shadow:0 4px 14px rgba(0,0,0,.25);
  cursor:pointer;
  z-index:400;        /* > #draftDimmer (300) so it stays UN-dimmed */
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .18s cubic-bezier(.25,.46,.45,.94),
             box-shadow .18s;
}

#draftCloseBtn:hover{
  transform:scale(1.12) rotate(90deg);
  box-shadow:0 6px 20px rgba(0,0,0,.30);
}

#draftCloseBtn:active{
  transform:scale(.95);
  box-shadow:0 3px 10px rgba(0,0,0,.20);
}

#draftCloseBtn svg{pointer-events:none;}


/* Freeze <body> scrolling when a modal is active */
body.no-scroll{
  overflow:hidden;          /* hides desktop scroll-bar   */
  overscroll-behavior:none; /* blocks rubber-band on iOS  */
}

/* ──────────────────────────────────────────────────────────
   Floating “Download PDF” button (shows during draft view)
   ────────────────────────────────────────────────────────── */
#draftDownloadBtn{
  position:fixed;
  top:22px;
  right:22px;                /* opposite the close button */
  width:46px;
  height:46px;
  border:none;
  border-radius:50%;
  background:linear-gradient(135deg,#4ade80 0%,#22c55e 100%);
  color:#fff;
  box-shadow:0 4px 14px rgba(0,0,0,.25);
  cursor:pointer;
  z-index:400;               /* same layer as #draftCloseBtn */
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .18s cubic-bezier(.25,.46,.45,.94), box-shadow .18s;
}
#draftDownloadBtn:hover{
  transform:scale(1.12);
  box-shadow:0 6px 20px rgba(0,0,0,.30);
}
#draftDownloadBtn:active{
  transform:scale(.95);
  box-shadow:0 3px 10px rgba(0,0,0,.20);
}
#draftDownloadBtn svg{pointer-events:none;}



/* =========================================================
   The google drive editing bar
   ========================================================= */

.draft-sheet .toolbar{
  display:flex;
  gap:4px;
  align-items:center;
  padding:4px 8px;
  background:#f8f9fa;
  border-bottom:1px solid #e0e0e0;
  position:sticky;  /* sticks to the top of the modal while scrolling */
  top:0;
  overflow-x:auto;
  z-index:5;        /* above the page content inside the modal */
}

.draft-sheet .toolbar select,
.draft-sheet .toolbar input[type=number]{
  padding:2px 4px;
  border:1px solid #e0e0e0;
  border-radius:4px;
  background:#fff;
  font-size:14px;
}

.draft-sheet .toolbar button{
  border:none;
  background:none;
  cursor:pointer;
  font-size:16px;
  padding:6px;
  color:#444;
  border-radius:4px;
}
.draft-sheet .toolbar button:hover,
.draft-sheet .toolbar button.active{
  background:#e8f0fe;
  color:#1a73e8;
}

.draft-sheet .icon-pair{display:flex}

/* editable area inside modal */
#draftEditor{
  padding:40px 60px;
  min-height:calc(100% - 56px); /* room for sticky bar */
  outline:none;
  line-height:1.5em;
}

/* hide scrollbars in macOS style overlay for a cleaner look (optional) */
.draft-sheet::-webkit-scrollbar{width:8px}
.draft-sheet::-webkit-scrollbar-track{background:transparent}
.draft-sheet::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.15);border-radius:4px;
}

/* =========================================================
   Global draft-edit toolbar – centred pill
   ========================================================= */
#draftToolbar{
  position:fixed;
  /* centre horizontally */
  top:0;
  left:50%;
  transform:translateX(-50%);

  /* auto-width pill */
  display:flex;
  gap:4px;
  align-items:center;
  padding:6px 12px;               /* extra side padding = nicer curve */
  background:#f8f9fa;
  border:1px solid #e0e0e0;
  border-top:none;                /* seamless with window edge */
  border-bottom-left-radius:12px;
  border-bottom-right-radius:12px;
  box-shadow:0 2px 6px rgba(0,0,0,.12);

  /* overflow */
  overflow-x:auto;
  max-width:calc(100% - 120px);   /* keep 60 px clear each side for ✕ & ⇩ */
  z-index:500;                    /* still above the dimmer */
}

#draftToolbar select,
#draftToolbar input[type=number]{
  padding:2px 4px;
  border:1px solid #e0e0e0;
  border-radius:4px;
  background:#fff;
  font-size:14px;
}

#draftToolbar button{
  border:none;
  background:none;
  cursor:pointer;
  font-size:16px;
  padding:6px;
  color:#444;
  border-radius:4px;
}
#draftToolbar button:hover,
#draftToolbar button.active{
  background:#e8f0fe;
  color:#1a73e8;
}

#draftToolbar .icon-pair{display:flex}

#draftCloseBtn,
#draftDownloadBtn{
  z-index: 600;         
}

#draftToolbar{
  z-index: 450;         
}

.draft-sheet{ padding-top:84px; }

/* Fix button size in draft view */
#draftCloseBtn,
#draftDownloadBtn {
  /* Enforce minimum size */
  min-width: 42px !important;
  min-height: 42px !important;
  
  /* Prevent content shrinking */
  flex-shrink: 0;
  
  /* Ensure consistent sizing */
  font-size: 22px;
  line-height: 1;
  
  /* Better content centering */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Specific size for download button (slightly larger) */
#draftDownloadBtn {
  min-width: 46px !important;
  min-height: 46px !important;
}

/* Keep the content from shrinking */
#draftCloseBtn > *,
#draftDownloadBtn > * {
  flex-shrink: 0;
  transform-origin: center;
}