/* =========================================
   Fonts
========================================= */

@font-face {
  font-family: "Barlow";
  src: url("./vendor/fonts/barlow-v13-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("./vendor/fonts/barlow-v13-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* =========================================
   Base + layout 
========================================= */
:root{
  --font: "Barlow", system-ui, Arial, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  --brand-blue: #0a1d42;
  --card-border:#ddd;
  --card-radius:6px;
  --card-pad:12px;

  --muted:#516273;
}

*,
*::before,
*::after{ box-sizing:border-box; }

body{
  font-family:var(--font);
  margin:20px;
  background:#f6f8fb;
  font-size:16px;
}

#report{
  max-width:80rem;
  margin:0 auto;
  padding-bottom:30px;
  font-family: var(--font);
  color: var(--brand-blue);
}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-end;
}
.row > div{ flex:1 1 100%; min-width:0; }

label{
  display:block;
  font-size:0.95rem;
  color:#334155;
  margin-bottom:4px;
}

input, select, button, textarea{
  padding:6px 8px;
  font-size:1rem;
  font-family:inherit;
}

table{ border-collapse:collapse; }
th, td{ border:1px solid var(--card-border); padding:6px; }

.card{
  border:1px solid rgba(2, 6, 23, 0.08);
  border-radius:12px;
  padding:var(--card-pad);
  margin:10px 0;
  width:100%;
  max-width:100%;
  background:#fff;
  box-shadow:0 4px 18px rgba(15, 23, 42, 0.06);
}

h3{ margin:0 0 10px; font-size:16px; }

#report .app-title,
h3,
.section-title,
.about-section-title,
.aboutSubTitle{
  color: var(--brand-blue);
}

/* =========================================
   App header
========================================= */
#report .app-header{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 0 14px;
  margin:0 0 18px;
  border-bottom:1px solid #e6e6e6;
  flex-wrap:nowrap;
}

#report .app-header{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 0 14px;
  margin:0 0 18px;
  border-bottom:1px solid #e6e6e6;
  flex-wrap:nowrap;
}

/* Hide header when embedded */
#report .app-header--embed-hidden{
  display:none;
}

#report img.app-logo{
  height:52px;
  width:auto;
  max-width:220px;
  object-fit:contain;
  display:block;
  flex:0 0 auto;
}

#report .app-title-block{
  display:flex;
  flex-direction:column;
  min-width:0;
  line-height:1;
  gap:0;
}

#report .app-title{
  margin:0;
  font-size:28px;
  font-weight:500;
  line-height:1;
  color: var(--brand-blue);
}

#report .app-subtitle{
  margin:0;
  padding:0;
  font-size:15px;
  line-height:1;
  color:var(--brand-blue);
  opacity:0.7;
}
#report .app-title + .app-subtitle{
  margin-top:-2px;
}

.beta-badge{
  font-size:12px;
  font-weight:500;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  background:#eef2ff;
  color:#1d4ed8;
  border:1px solid rgba(29,78,216,0.25);
  vertical-align:middle;
}

/* =========================================
   Sequence input + colored chips
========================================= */
.seq-input{ width:100%; max-width:100%; }

.seq-textarea{
  width:100%;
  height:140px;
  border:1px solid #e5ebf1;
  border-radius:12px;
  background:#fff;
  outline:none;
  resize:vertical;
  padding:16px 16px 0;
  font-family:var(--mono);
  font-size:18px;
  letter-spacing:.08em;
  line-height:1.6;
}

.seq-textarea:focus{
  box-shadow:0 0 0 4px rgba(10,29,66,0.12);
  border-color:rgba(10,29,66,0.55);
}

.seq-input__footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px 14px;
  border-top:1px solid #eef2f7;
  background:#f8fafc;
}

.seq-hint{
  font-size:16px;
  color:var(--muted);
}
.seq-counter{
  font-size:16px;
  font-family:var(--mono);
  color:#334155;
  background:#e2e8f0;
  padding:8px 16px;
  border-radius:999px;
}

#seqColored{ max-width:100%; line-height:1.9; }

.seq-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:32px;
  margin:2px;
  border-radius:6px;
  font-family:var(--mono);
  font-weight:700;
  font-size:16px;
  padding:0;
  cursor:help;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.12),
    0 1px 2px rgba(0,0,0,0.15);
}

/* =========================================
   Legend
========================================= */
.legend{
  display:flex;
  flex-wrap:nowrap;
  gap:18px;
  align-items:center;
  overflow-x:auto;
  white-space:nowrap;
}
.legend-item{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:4px 6px;
  color: var(--brand-blue); 
  font-size:14px;
  white-space:nowrap;
  flex:0 0 auto;
}
.legend-item .sw{
  width:20px;
  height:20px;
  border-radius:5px;
  border:1px solid #aaa;
  flex:0 0 auto;
}
.legend-item div:last-child{ font-weight:400; }
.legend-item:hover{ background:#f8fafc; border-radius:8px; }
.legend::-webkit-scrollbar{ height:6px; }
.legend::-webkit-scrollbar-thumb{ background:#cbd5e1; border-radius:999px; }

/* =========================================
   Charts layout + CTA buttons
========================================= */
.charts-row{
  display:flex;
  gap:12px;
  align-items:stretch;
  flex-wrap:wrap;
}
.charts-row .card{ flex:1 1 520px; }

.cta-row{
  margin-top:8px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;

  padding-top:10px;
  border-top:1px solid #eef2f7;
}

.cta-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.3rem 1.4rem;
  border-radius:20px;
  font-family:var(--font);
  font-weight:570;
  font-size:.8rem;
  line-height:1.2;
  letter-spacing:1px;
  text-transform:uppercase;
  text-decoration:none;
  border:0;
  cursor:pointer;
  color:#fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:filter .15s ease, transform .05s ease;
}
.cta-btn:hover{ filter:brightness(1.08); }
.cta-btn:active{ transform:translateY(1px); }
.cta-btn--blue{ background: var(--brand-blue); }
.cta-btn--orange{ background:#f28c28; }

/* Charts containers */
#predChart, #chargeChart{
  height:320px;
  min-height:320px;
}

/* =========================================
   Predict
========================================= */

.js-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.js-card-head h3 {
  min-width: 0;
  flex: 1 1 220px;
}

.js-mini-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.js-mini-controls .ctl-height {
  width: 120px;
}

@media (max-width: 640px) {
  .js-mini-controls {
    width: 100%;
  }

  .js-mini-controls .ctl-height {
    width: 72px;
  }

  .js-mini-controls button,
  .js-mini-controls input[type="color"] {
    flex: 0 0 auto;
  }
}

/* =========================================
   Properties card 
========================================= */
.prop-scope{
  --panel:#ffffff;
  --text:#0b1623;
  --muted:#516273;
  --border:#e5ebf1;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 6px 24px rgba(25,55,99,0.08);

  margin-top:20px;
}

.prop-card{
  width:100%;
  max-width:100%;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px 16px 12px;
}

.prop-card__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
  min-width:0;
}
.prop-card__title{
  font-weight:600;
  font-size:16px;
  min-width:0;
  color: var(--brand-blue);
}
.prop-card__actions .btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  color:var(--muted);
  background:transparent;
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
}

.prop-card__sequence{
  display:flex;
  align-items:center;
  gap:10px;
  margin:6px 0 10px;
  background:#f1f5f9;
  border:1px dashed var(--border);
  border-radius:var(--radius-sm);
  padding:10px 12px;
  flex-wrap:wrap;
  min-width:0;
}

.sequence{
  font-family:var(--mono);
  font-size:14px;
  letter-spacing:.5px;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
  min-width:0;
}

.chip{
  background:#e2e8f0;
  color:#111;
  padding:3px 8px;
  border-radius:999px;
  font-size:12px;
}

/* 3-letter sequence styling (Properties card) */
.prop-card .prop-card__sequence3{ margin-top:6px; }
.prop-card .prop-card__sequence3 code.sequence3{
  display:inline-block;
  padding:6px 10px;
  border-radius:8px;
  background:#f1f5f9;
  color:#334155;
  font-size:1.05em;
  font-weight:500;
  letter-spacing:0.03em;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.prop-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin:8px 0 6px;
}
@media (max-width:520px){
  .prop-grid{ grid-template-columns:1fr; }
}

.prop dt{ font-size:12px; color:var(--muted); }
.prop dd{ margin:3px 0 0; font-size:15px; font-weight:500; }
.unit{ color:var(--muted); margin-left:6px; }

.section-title{
  font-size:14px;
  font-weight:500;
  color:var(--brand-blue);
  text-transform:uppercase;
  letter-spacing:.06em;
  margin:10px 0 6px;
}

/* Composition tiles */
.comp-bars--tiles{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));
  gap:10px 12px;
}
.comp-tile{
  display:grid;
  grid-template-rows:auto 8px auto;
  align-items:center;
  justify-items:center;
  padding:8px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--panel);
}
.comp-tile .aa{ font-family:var(--mono); font-weight:700; font-size:14px; }
.bar-track{
  width:100%;
  height:8px;
  background:rgba(100,116,139,0.18);
  border-radius:6px;
  overflow:hidden;
}
.bar{ height:100%; }
.meta{ display:inline-flex; gap:8px; font-size:12px; color:var(--muted); }


/* =========================================
   Structure 
========================================= */
#structureBox{
  height:220px;
  overflow-x:auto !important;
  overflow-y:auto !important;
  white-space:nowrap;
}
#structureBox img{
  display:inline-block !important;
  max-width:none !important;
  max-height:none !important;
}

.structure-scroll{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  background:#fff;
  border-radius:8px;
  padding:8px;
  scrollbar-gutter: stable both-edges;
  text-align:center;
}
.structure-scroll img{
  display:block;
  height:auto;
  max-height:420px;
  width:auto;
  max-width:none;
  margin:0 auto;
}
.structure-placeholder{
  color:#777;
  padding:8px;
  white-space:nowrap;
}

/* =========================================
   3D viewer toolbar + tooltip + inputs
========================================= */
/* Hide NGL built-in tooltip/label */
.ngl-tooltip,
#ngl-tooltip{
  display:none !important;
}

.viewer-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:8px 0 10px;
}
.viewer-toolbar .sep{
  width:1px;
  height:26px;
  background:rgba(0,0,0,0.12);
  margin:0 4px;
}

.btn3d{
  appearance:none;
  border:1px solid rgba(0,0,0,0.12);
  background:#ffffff;
  color: var(--brand-blue);
  border-radius:10px;
  padding:8px 10px;
  font-weight:500;
  font-size:13px;
  cursor:pointer;
  box-shadow:0 1px 0 rgba(0,0,0,0.03);
}
.btn3d:hover{ background:rgba(0,0,0,0.03); }
.btn3d:active{ transform:translateY(1px); }
.btn3d.is-active{
  border-color:rgba(37, 99, 235, 0.35);
  box-shadow:0 0 0 3px rgba(37, 99, 235, 0.12);
}

.viewer3d{
  height:420px;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
  position:relative;
  border:1px solid rgba(0,0,0,0.08);
  box-shadow:0 8px 26px rgba(15, 23, 42, 0.08);
}

.viewer3d-tooltip{
  position:fixed;
  pointer-events:none;
  z-index:9999;
  padding:4px 8px;
  border-radius:8px;
  background:rgba(17, 24, 39, 0.92);
  color:#fff;
  font-size:12px;
  line-height:1.2;
  transform:translate(10px, 10px);
  opacity:0;
  transition:opacity 80ms linear;
  white-space:nowrap;
}
.viewer3d-tooltip.is-visible{ opacity:1; }

/* FASTA/BILD inputs */
.viewer-inputs{
  margin-top:12px;
  width:100%;
}
.viewer-row{
  display:grid;
  grid-template-columns:1fr 110px;
  gap:10px;
  align-items:center;
  width:100%;
  margin-top:10px;
}
.viewer-row:first-child{ margin-top:0; }

.viewer-btn{
  width:110px;
  min-width:110px;
  max-width:110px;
  white-space:nowrap;
}

.mini-seq-input{
  width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;

  height:44px;
  padding:10px 12px !important;

  border:1px solid #d0d7de !important;
  border-radius:12px !important;
  background:#fff !important;

  font-family:var(--mono) !important;
  font-size:16px !important;
  letter-spacing:0.06em;
  line-height:1;

  outline:none !important;
}
.mini-seq-input::placeholder{
  font-family:var(--font);
  letter-spacing:0;
  color:#64748b;
}
.mini-seq-input:focus{
  border-color:rgba(37, 99, 235, 0.55) !important;
  box-shadow:0 0 0 4px rgba(37, 99, 235, 0.14) !important;
}

/* =========================================
   Footer
========================================= */
.app-footer a{
  color:inherit;
  text-decoration:none;
  font-weight:500;
}
.app-footer a:hover{ text-decoration:underline; }
.footer-sep{ opacity:0.7; }

/* =========================================
   Legal modals + tabs
========================================= */
.legal-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  padding:24px;
  z-index:9999;
}

.legal-modal__panel{
  max-width:860px;
  margin:40px auto;
  background:#fff;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
  max-height:80vh;
  overflow:auto;
  padding:16px 18px 14px;
}

.legal-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.legal-modal__header h3{ margin:0; }

.legal-modal__close{
  border:1px solid #ddd;
  border-radius:10px;
  padding:8px 10px;
  background:#fff;
  cursor:pointer;
}

.legal-modal__body{
  margin-top:12px;
  line-height:1.5;
}
.legal-modal__body h4{ margin:14px 0 6px; }

.about-section-title{
  margin:6px 0 2px;
  font-size:16px;
}
.about-section-subtitle{
  margin:0 0 10px;
  color:#666;
  font-size:13px;
}

/* Tabs */
.aboutNav, .aboutSubNav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 12px;
}

.aboutNav__btn, .aboutSubNav__btn{
  border:1px solid #ddd;
  background:#f6f6f6;
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
  font:inherit;
}

.aboutNav__btn.is-active, .aboutSubNav__btn.is-active{
  background:#fff;
  font-weight:600;
  border-color:#cfcfcf;
}

.aboutPane{ display:none; }
.aboutPane.is-active{ display:block; }

.aboutSubPane{ display:none; }
.aboutSubPane.is-active{ display:block; }

.aboutSubTitle{
  margin:2px 0 10px;
  color:#666;
  font-size:13px;
}

/* =========================================
   JS injected mini controls
========================================= */
.js-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.js-mini-controls{
  display:inline-flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.js-mini-controls label{
  display:inline-flex !important;
  align-items:center;
  gap:6px;
  margin:0;
  font-size:12px;
  color:#475569;
  white-space:nowrap;
}

.js-mini-controls .ctl-height{
  width:110px;
  padding:0; /* override global input padding */
}

.js-mini-controls .ctl-color{
  width:28px;
  height:22px;
  padding:0;
  border:0;
  background:transparent;
}

.js-mini-controls .ctl-reset,
.js-mini-controls .ctl-resetview{
  width:28px;
  height:24px;
  padding:0; /* override global button padding */
  border-radius:8px;
  border:1px solid #e5ebf1;
  background:#fff;
  cursor:pointer;
  line-height:1;
}
.js-mini-controls .ctl-reset:hover,
.js-mini-controls .ctl-resetview:hover{
  filter:brightness(0.98);
}

/* =========================================
   PDF-only 
========================================= */
#report.pdf-exporting .charts-row{ display:block !important; }
#report.pdf-exporting .charts-row .card{ flex:none !important; width:100% !important; }

#report.pdf-exporting .legend{
  flex-wrap:wrap !important;
  white-space:normal !important;
  overflow:visible !important;
}

#report.pdf-exporting #seqColored{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:4px !important;
  overflow:visible !important;
  line-height:normal !important;
}
#report.pdf-exporting #seqColored .seq-chip{ flex:0 0 auto; }

#report.pdf-exporting .js-mini-controls{ display:none !important; }

#report.pdf-exporting,
#report.pdf-exporting *{
  box-sizing:border-box !important;
}

#report.pdf-exporting .card,
#report.pdf-exporting .prop-card{
  overflow:hidden !important;
  max-width:100% !important;
}

#report.pdf-exporting img,
#report.pdf-exporting canvas,
#report.pdf-exporting svg,
#report.pdf-exporting table{
  max-width:100% !important;
}

#report.pdf-exporting .prop-card__header,
#report.pdf-exporting .prop-card__sequence,
#report.pdf-exporting .cta-row{
  flex-wrap:wrap !important;
  min-width:0 !important;
}

#report.pdf-exporting .sequence,
#report.pdf-exporting #predSummary{
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
}

/* Hide interactive UI in PDF */
#report.pdf-exporting .cta-row,
#report.pdf-exporting button,
#report.pdf-exporting a.cta-btn,
#report.pdf-exporting .prop-card__actions,
#report.pdf-exporting .viewer-toolbar,
#report.pdf-exporting .viewer-inputs{
  display:none !important;
}

/* If any sequence UI slips in, force-hide */
#report.pdf-exporting .seq-input,
#report.pdf-exporting #seqColored,
#report.pdf-exporting #legend{
  display:none !important;
}

/* Optional: nicer About card text spacing */
.pdf-about p{
  font-size: 14px;
  color: #334155;
}
#report.pdf-exporting img.app-logo{
    height:52px !important;
    width:auto !important;
    max-width:220px !important;
    object-fit:contain !important;
    display:block !important;
}
/* =========================================
   PDF-only 
========================================= */

#pdfExportRoot{
    /* safety: ensure clone looks like a page */
    background: #fff;
}

#pdfExportRoot.pdf-exporting,
#pdfExportRoot.pdf-exporting *{
    box-sizing: border-box !important;
}

/* Layout fixes: charts stack vertically in PDF */
#pdfExportRoot.pdf-exporting .charts-row{
    display: block !important;
}
#pdfExportRoot.pdf-exporting .charts-row .card{
    flex: none !important;
    width: 100% !important;
}

/* Hide mini Plotly controls */
#pdfExportRoot.pdf-exporting .js-mini-controls{
    display: none !important;
}

/* Hide interactive UI in PDF */
#pdfExportRoot.pdf-exporting .cta-row,
#pdfExportRoot.pdf-exporting button,
#pdfExportRoot.pdf-exporting a.cta-btn,
#pdfExportRoot.pdf-exporting .prop-card__actions,
#pdfExportRoot.pdf-exporting .viewer-toolbar,
#pdfExportRoot.pdf-exporting .viewer-inputs{
    display: none !important;
}

/* If any sequence UI slips in, force-hide it in PDF */
#pdfExportRoot.pdf-exporting .seq-input,
#pdfExportRoot.pdf-exporting #seqColored,
#pdfExportRoot.pdf-exporting #legend{
    display: none !important;
}

/* Prevent overflow/wrapping issues */
#pdfExportRoot.pdf-exporting .card,
#pdfExportRoot.pdf-exporting .prop-card{
    overflow: hidden !important;
    max-width: 100% !important;
}

#pdfExportRoot.pdf-exporting img,
#pdfExportRoot.pdf-exporting canvas,
#pdfExportRoot.pdf-exporting svg,
#pdfExportRoot.pdf-exporting table{
    max-width: 100% !important;
}

/* Wrap long text nicely */
#pdfExportRoot.pdf-exporting .sequence,
#pdfExportRoot.pdf-exporting #predSummary{
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Logo sizing in PDF */
#pdfExportRoot.pdf-exporting img.app-logo{
    height: 52px !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain !important;
    display: block !important;
}

/* =========================
   PDF: make Properties compact
   ========================= */
#pdfExportRoot.pdf-exporting .prop-card{
    padding: 10px !important;
    font-size: 12px !important;
}

#pdfExportRoot.pdf-exporting .prop-card__title{
    font-size: 14px !important;
}

#pdfExportRoot.pdf-exporting .prop-card__sequence,
#pdfExportRoot.pdf-exporting .prop-card__sequence3{
    font-size: 11px !important;
}

/* Force 2-column grid to reduce height */
#pdfExportRoot.pdf-exporting .prop-grid{
    gap: 8px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}


#pdfExportRoot.pdf-exporting .comp-bars{
    display: grid !important;
}

/* About text styling */
#pdfExportRoot.pdf-exporting .pdf-about p{
    font-size: 14px;
    color: #334155;
}

