html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Sheets: miniaturer og referencebilleder */
.sheet-thumb {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bs-tertiary-bg);
}

.sheet-billede {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--bs-tertiary-bg);
}

/* Illustrationer: tidslinje, billede med nåle, kommentarer, godkendelser */
.tidslinje-punkt {
  flex: 0 0 auto;
  width: 84px;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  border-radius: .4rem;
  padding: 2px;
  opacity: .75;
}
.tidslinje-punkt img, .tidslinje-tom {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: .3rem;
  background: var(--bs-tertiary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tidslinje-punkt:hover { opacity: 1; }
.tidslinje-punkt.valgt { border-color: var(--bs-primary); opacity: 1; }

/* Rammen får billedets størrelse, så nålenes procenter passer; billedet holdes inden for skærmhøjden */
.billede-ramme { background: var(--bs-tertiary-bg); border-radius: .4rem; overflow: hidden; width: fit-content; max-width: 100%; margin: 0 auto; }
.billede-ramme > img { display: block; max-width: 100%; max-height: 75vh; width: auto !important; height: auto; }
.billede-tom { min-height: 20rem; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--bs-secondary-color); padding: 2rem; }

.naal, .naal-maerke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.4);
}
.naal { position: absolute; transform: translate(-50%, -50%); }
.naal:hover { color: #fff; transform: translate(-50%, -50%) scale(1.15); }
.naal-maerke { width: 1.25rem; height: 1.25rem; font-size: .7rem; box-shadow: none; }

.kommentar:target { background: #fff3cd; border-radius: .3rem; }
.kommentar-tekst { white-space: pre-wrap; }
.prompt-brugt { white-space: pre-wrap; background: var(--bs-tertiary-bg); padding: .5rem; border-radius: .3rem; max-height: 20rem; }

.godkender { font-size: .9rem; }
.stjerne { color: #f0ad00; }
.stjerne-tom { color: var(--bs-secondary-color); }

/* Træk og slip af billeder til nye sheets */
.sheet-drop {
  border: 2px dashed var(--bs-border-color);
  border-radius: .5rem;
  padding: .75rem 1rem;
  background: var(--bs-tertiary-bg);
  transition: background .15s, border-color .15s;
}
.sheet-drop.over { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.sheet-drop.arbejder { opacity: .6; pointer-events: none; }

/* Bogens sider: lodret liste der kan sorteres */
.side-raekke { cursor: default; }
.side-raekke.trækkes { opacity: .4; }
.side-raekke .traek { cursor: grab; font-size: 1.2rem; position: relative; z-index: 2; user-select: none; }
.side-nr { width: 1.5rem; text-align: right; }
.side-thumb { width: 4.5rem; height: 4.5rem; display: flex; align-items: center; justify-content: center; background: var(--bs-tertiary-bg); border-radius: .3rem; overflow: hidden; }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.min-w-0 { min-width: 0; }

/* Lup over hovedbilledet */
.lup {
  display: none;
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);
  background-repeat: no-repeat;
  background-color: #000;
  pointer-events: none;
  z-index: 1050;
}
.lup::after {
  content: attr(data-zoom);
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .7rem;
  color: #fff;
  background: rgba(0,0,0,.5);
  border-radius: .5rem;
  padding: 0 .4rem;
}
#lupKnap.active { background: var(--bs-secondary); color: #fff; }

/* Flag (a), (b) … på billedet til promptfeltet */
#flagLag { position: absolute; inset: 0; pointer-events: none; }
.prompt-flag {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  z-index: 3;
}
/* Flagstangen står på punktet; mærket med bogstavet vajer til højre */
.prompt-flag::before {
  content: "";
  position: absolute;
  left: -1px;
  bottom: 0;
  width: 2px;
  height: 30px;
  background: #212529;
  box-shadow: 0 0 0 1px #fff;
}
.prompt-flag-maerke {
  position: absolute;
  left: 1px;
  bottom: 14px;
  min-width: 1.4rem;
  padding: 0 .3rem;
  background: #ffc107;
  color: #000;
  font-weight: 700;
  font-size: .8rem;
  line-height: 1.1rem;
  text-align: center;
  border-radius: 0 .25rem .25rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.prompt-flag-maerke::before { content: "("; }
.prompt-flag-maerke::after { content: ")"; }
.prompt-flag.traekkes { cursor: grabbing; }
.prompt-flag.slettes .prompt-flag-maerke { background: #dc3545; color: #fff; }
.prompt-flag.slettes .prompt-flag-maerke::after { content: ") ✕ slet"; }
.billede-ramme.flag-tilstand { cursor: crosshair; outline: 3px dashed #ffc107; }
#flagKnap.active { background: #dc3545; color: #fff; }
