/* ================================
   🌑 Baslayout & Body
   ================================ */

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  font-family: 'Segoe UI', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}



/* Specifikt för login/index */
body.main-page {

  flex-direction: column;
  display: block !important;     /* var flex i globala CSS:en */
  height: auto !important;       /* överskriv global 100vh */
  padding: 16px;
  align-items: center;
  min-height: 100svh;

  font-family: sans-serif;

  /* Mörkblå till ljusblå gradient */
  background: linear-gradient(to bottom, #002b5c 0%, #3399cc 100%);
  background-repeat: no-repeat;
  background-attachment: scroll;
}
.container {
  padding-top: 32px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.error {
  box-shadow: inset 0 0 0 4px red;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; /* ← Nu centrerat korrekt */
}

.logo {
  max-width: 160px;
  height: auto;
  width: 100%;
}

@media (max-width: 768px) {
  .logo {
    max-width: 120px;
  }

}



.search-input {

  width: 200px;
  min-width: 200px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 12px;
  margin-left: 10px;
  font-family: 'Segoe UI', sans-serif;
}
.search-input.has-text {
  background: #fffbe3;  /* ljusgul */
}

.marketcap-input {
  width: 11em;
  margin-left: 2px;
  margin-right: 12px;
  background: #fff;
  border: 1px solid #ccc;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 1em;
  transition: border 0.2s;
}
.marketcap-input:focus {
  border: 1.5px solid #f2c700;
  outline: 2px solid rgba(242,199,0,.35);
  background: #fffbe3;
}
.marketcap-input:disabled {
  background-color: #f0f0f0;  /* ljusgrå bakgrund */
  color: #999;                /* ljusare text */
  border: 1px solid #ccc;     /* tunn grå ram */
  cursor: not-allowed;        /* förbjud-symbol på muspekaren */
  opacity: 0.7;               /* lite transparent */
}

.reset-zoom-btn {
  background-color: #191970; /* Midnight Blue */
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  margin-left: 10px;
  cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
  transition: background-color 0.3s ease;
}

.reset-zoom-btn:hover {
  background-color: #000080; /* Navy */
}


/* Space to the right of the checkbox */
.toggle-highlight {
  margin-right: 10px; /* adjust as needed */
}

/* ================================
   📦 Wrapper & SVG
   ================================ */
.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative; 
}




svg {
  flex: 1;
  width: 100%;
  display: block;
  overflow: visible;


}


/* ================================
   🧰 Verktygsrad / Toolbar
   ================================ */
.toolbar {
  background: #000;
  color: #fff;
  padding-top:1px;
  padding-bottom:1px;
  font-size: 14px;
  display: flex;
  gap: 5px;
  align-items: center;
  z-index: 5;
  container-type: inline-size; 
  min-height: 32px;
    flex-wrap: wrap;
}
/* Se till att den inladdade .toolbar blir “riktig” toolbar */
#toolbar-container > .toolbar {
  width: 100%;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}


.toolbar select {
  margin-left: 2px;
  background: #222;
  color: white;
  border: 1px solid #555;
  padding: 2px 8px;
  border-radius: 6px;
}

.toolbar label,
.toolbar select {
 padding-left: 10px;	
  line-height: 2;
}

/* ---- Toolbar: högersektion + språkknapp ---- */
/* --- Toolbar: spacer + right group + language toggle --- */
.toolbar-spacer { flex: 1 1 auto; }

.toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;         /* krymp inte, wrappa senare om det MÅSTE */
  order: 999;             /* säkerställ sist i raden */
  white-space: nowrap;
}

.lang-toggle {
  background: linear-gradient(180deg, #1a1d26, #131722);
  border: 1px solid #3a4155;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 4px 10px;
  min-width: 42px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease, border-color .15s ease;
  user-select: none;
}
.lang-toggle:hover { border-color: #59627a; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.lang-toggle:active { transform: translateY(1px); }

/* Flag icons (SVG via data: URL) */
.flag {
  display: inline-block;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(58,65,85,.9); /* tunn kant */
}

/* Sweden (SE) */
.flag-se {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 10"><rect width="16" height="10" fill="%23006AA7"/><rect x="5" width="2" height="10" fill="%23FECC00"/><rect y="4" width="16" height="2" fill="%23FECC00"/></svg>');
}

/* United Kingdom (GB) — förenklad Union Jack */
.flag-gb {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 10"><rect width="16" height="10" fill="%2300123A"/><path d="M0,0 L16,10 M16,0 L0,10" stroke="%23FFFFFF" stroke-width="2"/><path d="M0,0 L16,10 M16,0 L0,10" stroke="%23C8102E" stroke-width="1"/><rect x="7" width="2" height="10" fill="%23FFFFFF"/><rect y="4" width="16" height="2" fill="%23FFFFFF"/><rect x="7.5" width="1" height="10" fill="%23C8102E"/><rect y="4.5" width="16" height="1" fill="%23C8102E"/></svg>');
}


.home-icon {
  font-size: 16px;
  text-decoration: none;
  color: white;
  margin-right: 2px;
  margin-left: 4px;
  user-select: none;
}

.home-icon:hover {
  color: #ffeb3b;
  text-decoration: none;
}


.info-container {
  position: relative;
  display: inline-block;
  margin-left: 2px;
}
.info-icon {
  font-size: 16px;
  cursor: help;
  margin-left: 2px;
  margin-right: 4px;
  user-select: none;
}


.custom-tooltip {
  width: 400px;

  position: absolute;
  display: none;
  background-color: #333; /* Mörk bakgrund */
  color: white;           /* Vit text */
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 700px;       /* Tillåter radbrytning */
  z-index: 9999;
  white-space: pre-wrap;
  pointer-events: none;   /* Så den inte blockerar musen */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.info-container:hover .custom-tooltip {
  visibility: visible;
  opacity: 1;
}
/* ================================
   📁 Filuppladdning
   ================================ */
/* Filsektionen blir egen container (så cqw kan mäta mot just den) */
.file-selection-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 400px;  /* får ta plats men kan krympa */
  min-width: 0;     /* tillåt barn att krympa inuti */
  container-type: inline-size; /* <-- viktig! */
}
.custom-file-upload {
  display: inline-flex;
  align-items: center;
  gap: .5em;

  /* Skala mot containerbredd (cqw). clamp ger trevliga tak/golv. */
  font-size: clamp(12px, 1.1cqw + 0.25rem, 14px);
  padding: clamp(6px, 0.7cqw + 2px, 10px) clamp(10px, 1.3cqw + 2px, 14px);
  border-radius: clamp(3px, 0.35cqw, 6px);

  background-color: #222;
  color: #fff;
  border: 1px solid #555;
  cursor: pointer;
  white-space: nowrap;
}
/* Extra spärr för riktigt smala vyer – filsektionen får hela raden */
@media (max-width: 560px) {
  .file-selection-container { flex-basis: 100%; }
}
@media (max-width: 360px) {
  .custom-file-upload {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
  }
}

.file-name-display {
  min-width: 0;           /* nyckeln för att få flexitem att krympa */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: #ccc;
  font-style: italic;
  padding-right: 2rem;

  /* Skala även texten lite med containern */
  font-size: clamp(11px, 0.7cqw + 10px, 13px);
}

#fileInput {
  display: none;
}

#fileNameDisplay {
  margin-left: 10px;
  color: #ccc;
  font-style: italic;
  font-size: 13px;
  padding-right: 2rem;
}

/* ================================
   🧱 Treemap Labels
   ================================ */
.label {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1px;
  fill: white;
}

.value-label {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  fill: white;
  font-size: 16px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

/* ================================
   💬 Tooltip
   ================================ */
.tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
   pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;

  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;

  /* Nytt */
  z-index: 1000;
  white-space: normal; /* Tillåter radbrytning för långa rader */
  line-height: 1.4;
}

/* Valfri scrollbar-stil för WebKit-baserade webbläsare */
.tooltip::-webkit-scrollbar {
  width: 6px;
}
.tooltip::-webkit-scrollbar-thumb {
  background-color: #666;
  border-radius: 3px;
}


/* ================================
   💬 Tooltip
   ================================ */
.tooltip-transactions-list {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
   pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s;

  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;

  /* Nytt */
  z-index: 1000;
  white-space: normal; /* Tillåter radbrytning för långa rader */
  line-height: 1.4;
}
/* ================================
   🎨 Legend
   ================================ */
.legend {
  position: relative;
  flex: 0 0 32px;   /* “låst” flexhöjd */
  height: 32px;
  margin: 0 8px 4px 16px; /* ta bort negativ top-marginal */
  display: flex;
  gap: 4px;
  align-items: center;   /* var tidigare flex-end */
  font-size: 11px;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;      /* förhindra radbrytning som höjer raden */
}
.legend .legend-item { flex: 0 0 auto; }

.legend-color {
  width: 48px;
  height: 12px;
  margin-bottom: 1px;
  border: 1px solid #222;
}



/* ================================
   🕳 Tomvy (innan data)
   ================================ */
#empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #888;
  font-size: 32px;
  text-align: center;
  z-index: 2;
}

/* ================================
   🖋 Fotnot / Credit
   ================================ */
.credit {
  margin-top: auto;
  text-align: center;
  padding: 0px,10px,2px,10px;
 

  color: #ccc;
  /* ljusare färg för bättre kontrast */
  font-size: 14px;

  font-weight: bold;

  opacity: 0.9;

  z-index: 10;
  text-shadow: 0 0 2px #000;
}





.credit a {
  color: #eee;
  text-decoration: none;
}

.credit a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ================================
   💰 Totalruta
   ================================ */
.total-box {
 position: fixed;     /* istället för absolute */
  bottom: 10px;        /* avstånd från sidans botten */
  right: 24px;         /* avstånd från högra kanten */
  color: #ffd700;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 12px;
  font-size: 24px;
  font-weight: bold;
  margin-top: 4px;
  border-radius: 2px;
  z-index: 10;
}



/* ================================
   🖋 Transaction summary
   ================================ */

#summary-box {
 position: fixed;     /* istället för absolute */
  bottom: 10px;        /* avstånd från sidans botten */
  right: 24px;         /* avstånd från högra kanten */
  right: 18px;
  color: #ffd700;
  background: rgba(0, 0, 0,0.2);
  padding: 1px 12px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
  z-index: 10;
   display: inline-block; /* så att den inte tar hela bredden */
}


footer {
  margin-top: 60px;
  margin-bottom: 5px;
  font-size: 13px;
  color: #ccc;
}

footer a {
  color: #ccc;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}


/* ================================
   🖋 Feedback button
   ================================ */
   
.feedback-button {
  background-color: #ffa500;
  color: white;
  font-size: 0.8rem;
  padding: 3px 6px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.feedback-button:hover {
  background-color: #e59400;
}

/* Modal bakgrund */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 6px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh; /* 💡 Lägg till detta */
  overflow-y: auto;  /* 💡 Scrolla om för lång */
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.modal-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-body label {
  font-weight: bold;
}

.modal-body input,
.modal-body textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box; /* 💡 Lägg till detta */
}

.modal-body textarea {
  min-height: 100px;
  max-height: 200px; 
  resize: vertical;
}

.modal-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.submit-button {
  background-color: #f7c200;
  color: black;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.submit-button:hover {
  background-color: #e6b200;
}

.cancel-button {
  background-color: #ddd;
  color: #333;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.cancel-button:hover {
  background-color: #ccc;
}

.help-text {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.5rem;
}



.manage-favorites-btn:hover {
  background-color: #3a3a3a;
}


.manage-favorites-btn {
  background-color: #2a2a2a; 
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  margin-left: 10px;
  cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
  transition: background-color 0.3s ease;
}

/* Open button style (next to reset zoom) */
.manage-favorites-btn {
  background: linear-gradient(180deg, #1a1d26, #131722);
  border: 1px solid var(--fav-border);
  color: var(--fav-text);
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  margin-left: 10px;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease, border-color .15s ease;
}
.manage-favorites-btn:hover {
  border-color: #3a4155;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.manage-favorites-btn:active { transform: translateY(1px); }


/* ----- Favorites Modal (overlay) ----- */
/* ---------- Theme tokens ---------- */
:root {
  --fav-bg: #0f1115;
  --fav-border: #232633;
  --fav-text: #e7e9ee;
  --fav-muted: #b3b8c5;
  --fav-overlay: rgba(10, 12, 16, 0.6);
  --fav-accent: #7cc4ff;
  --fav-danger: #ff5c5c;
  --radius: 14px;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
}

/* No page scroll while modal open */
body.modal-open {
  overflow: hidden;
}

/* ---------- Overlay + enter/exit animation ---------- */
.fav-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--fav-overlay);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 9999;
}
.fav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Dialog with subtle “pop” */
.fav-dialog {
  width: min(92vw, 620px);
  background: linear-gradient(180deg, #11141b 0%, var(--fav-bg) 100%);
  border: 1px solid var(--fav-border);
  border-radius: var(--radius);
  color: var(--fav-text);
  box-shadow: var(--shadow);
  transform: translateY(8px) scale(.98);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.fav-overlay.show .fav-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.fav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--fav-border);
}
.fav-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
  color: var(--fav-text);
}

/* Close buttons */
.fav-close {
  background: transparent;
  border: 0;
  color: var(--fav-muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: 10px;
  padding: 6px 10px;
  transition: background-color .15s ease, color .15s ease;
}
.fav-close:hover { color: var(--fav-text); background: rgba(255,255,255,.05); }

/* Body */
.fav-body {
  max-height: 65vh;
  overflow: auto;
  padding: 8px 0;
}
.fav-empty {
  opacity: .75;
  padding: 18px;
  text-align: center;
}

/* Items */
.fav-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--fav-border);
}
.fav-name {
  font: 500 14px/1.3 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--fav-text);
  letter-spacing: .2px;
}
.fav-ticker {
  display: inline-block;
  font: 600 12px/1 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--fav-accent);
  background: rgba(124,196,255,.12);
  border: 1px solid rgba(124,196,255,.25);
  padding: 4px 8px;
  border-radius: 999px;
  margin-left: 10px;
}

/* Remove pill button */
.fav-remove {
  appearance: none;
  background: transparent;
  border: 1px solid #3a2a2a;
  color: #ffd0d0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .04s ease;
}
.fav-remove:hover {
  background: rgba(255, 92, 92, .12);
  border-color: rgba(255, 92, 92, .4);
}
.fav-remove:active { transform: translateY(1px); }

/* Footer */
.fav-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--fav-border);
}
/* Sort control */
.fav-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto; /* skjut mot höger */
}
.fav-sort-select {
  appearance: none;
  background: #171b24;
  color: var(--fav-text, #e7e9ee);
  border: 1px solid var(--fav-border, #232633);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.fav-sort-select:hover {
  border-color: #3a4155;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.fav-banner {
  padding: 10px 16px;
  font: 500 13px/1.3 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  border-top: 1px solid var(--fav-border, #232633);
  border-bottom: 1px solid var(--fav-border, #232633);
  background: rgba(255, 92, 92, .12);
  color: #ffd0d0;
}


/* Nice scrollbar for modal lists (WebKit) */
.fav-body::-webkit-scrollbar { width: 10px; }
.fav-body::-webkit-scrollbar-track { background: #0d0f14; }
.fav-body::-webkit-scrollbar-thumb {
  background: #2b3142; border-radius: 10px; border: 2px solid #0d0f14;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fav-overlay, .fav-dialog { transition: none; }
}

.bar-label {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:root {
  --bar-start: #2f6bbd; /* mörkare botten */
  --bar-end:   #4a90e2; /* ljusare topp */
  --axis-stroke: #6b7280;
  --grid-stroke: #2f3640;
  --label-fill: #fff;
}
.bar { fill: var(--bar-fill); }
.x-axis .domain, .x-axis .tick line,
.y-grid .tick line { stroke: var(--axis-stroke); }



/* 🔒 Scoped till just utdelnings-stapeldiagrammet */
#dividends-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  display: none; opacity: 0; transform: translateY(4px) scale(0.98);
  transition: opacity 120ms ease, transform 120ms ease;
  background: linear-gradient(180deg, rgba(22,28,36,0.85), rgba(22,28,36,0.92));
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  border-radius: 12px; padding: 10px 12px; color: #eef2f7;
  min-width: 220px; line-height: 1.3; white-space: normal;
  max-width: min(92vw, 1600px);
}
#dividends-tooltip.is-visible { display: block; opacity: 1; transform: translateY(0) scale(1); }
#dividends-tooltip::after {
  content:""; position:absolute; width:10px; height:10px; background:inherit;
  border-left:1px solid rgba(255,255,255,0.08); border-top:1px solid rgba(255,255,255,0.08);
  transform: rotate(45deg); filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
}
#dividends-tooltip[data-pos="right"]::after { left:-6px; top:14px; }
#dividends-tooltip[data-pos="left"]::after  { right:-6px; top:14px; transform: rotate(225deg); }

/* Inre delar (bara i denna tooltip) */
#dividends-tooltip .tip-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px;}
#dividends-tooltip .tip-title{font-weight:700;letter-spacing:.2px;}
#dividends-tooltip .tip-total{font-weight:600;opacity:.95;margin:2px 0 6px;}
#dividends-tooltip .tip-divider{border:none;border-top:1px solid rgba(255,255,255,0.10);margin:8px 0;}
#dividends-tooltip .pill{display:inline-flex;align-items:center;gap:6px;padding:2px 8px;border-radius:999px;font-size:12px;border:1px solid rgba(255,255,255,0.08);background:rgba(255,255,255,0.06);}
#dividends-tooltip .pill--up{background:rgba(0,200,83,.15);color:#9affb4;}
#dividends-tooltip .pill--down{background:rgba(255,82,82,.18);color:#ff9a9a;}
#dividends-tooltip .pill--flat{background:rgba(255,255,255,.08);color:#cfd8e3;}
#dividends-tooltip .tip-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px;}
#dividends-tooltip .chip{font-size:12px;padding:3px 8px;border-radius:999px;border:1px dashed rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);}
/* Alltid EN kolumn i listan */
#dividends-tooltip .tip-list {
  column-count: 2 !important;
  column-gap: 2 !important;
}
#dividends-tooltip .tip-row{break-inside:avoid;opacity:.95;}
@media (min-width:520px){
  #dividends-tooltip .tip-list[data-cols="2"]{column-count:2;}
  #dividends-tooltip .tip-list[data-cols="3"]{column-count:3;}
}










/* ==== FW Modal (namespaced, no conflicts) ==== */
/* ==== FinWiz modal (namespaced, robust i prod/dev) ==== */
#sym-modal[hidden]{ display:none !important; }

#sym-modal.fw-modal-backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 10000;
}

/* Absolut centrerad, immun mot globala .modal-regler */
#sym-modal .fw-modal{
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(1200px, 96vw);
  max-height: min(92vh, 900px);
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0,0,0,.45);
  display: flex; flex-direction: column;
  box-sizing: border-box;
  overflow: hidden; /* innehåll puttar inte modalen */
  font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (min-width: 1440px) {
  #sym-modal .fw-modal {
    width: min(1320px, 96vw);
  }
}

#sym-modal .fw-modal-header,
#sym-modal .fw-modal-footer{ padding:10px 12px; border-color:#334155; }
#sym-modal .fw-modal-header{ display:flex; align-items:center; gap:10px; border-bottom:1px solid; }
#sym-modal .fw-modal-title { font-weight:500; font-size:15px; color:#f1f5f9; }
#sym-modal .fw-modal-close { margin-left:auto; background:transparent; border:1px solid #334155; color:#e5e7eb; border-radius:8px; padding:4px 8px; cursor:pointer; }
#sym-modal .fw-modal-footer{ display:flex; justify-content:flex-end; gap:10px; border-top:1px solid; }

/* Endast mitten scrollar */
#sym-modal .fw-modal-scroll{ flex:1; min-height:0; overflow:auto; padding:10px 12px; }

/* Toolbar i modalen */
#sym-modal .fw-modal-toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
#sym-modal .fw-modal-toolbar .spacer{ flex:1; }
#sym-modal .fw-modal-toolbar input{
  background:#0b1220; border:1px solid #334155; color:#e5e7eb;
  border-radius:8px; height:30px; padding:0 10px; font-size:13px;
}

/* Sektionerad symbolkarta */
#sym-modal .group-section{ margin:10px 0 12px; background:#111827; border:1px solid #334155; border-radius:8px; overflow:hidden; }
#sym-modal .group-header{ position:sticky; top:0; z-index:1; background:#1e293b; color:#e5e7eb; font-weight:500; font-size:14px; padding:6px 10px; border-bottom:1px solid #334155; }
#sym-modal .group-body{ display:grid; grid-template-columns:repeat(auto-fill, minmax(190px,1fr)); gap:6px 10px; padding:8px 10px; }

#sym-modal .option-row{ display:flex; align-items:center; gap:6px; background:#0f172a; border:1px solid #334155; border-radius:6px; padding:4px 6px; font-size:13px; }
#sym-modal .option-row .sym{ font-weight:500; color:#e5e7eb; }
#sym-modal .option-row .label{ color:#9ca3af; font-weight:400; }

/* Knappar (återanvänder dina .btn/.btn-primary) */
#sym-modal .btn{ background:#1e293b; border:1px solid #3b4252; color:#e5e7eb; padding:5px 12px; border-radius:6px; font-size:13px; cursor:pointer; }
#sym-modal .btn:hover{ background:#2d3748; }
#sym-modal .btn-primary{ background:#1f2937; border-color:#60a5fa; box-shadow:0 0 0 2px rgba(96,165,250,.25) inset; }


/* Gör HTML-legendens text tydligare (legend är HTML, inte SVG) */
#legend .legend-item {
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
}