*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151c2b 0, #050810 60%, #000000 100%);
  color: #f2f4ff;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

.panel {
  background: radial-gradient(circle at top, rgba(79, 91, 255, 0.18), rgba(11, 15, 35, 0.95));
  border-radius: 1.3rem;
  padding: 1rem 1.2rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.panel-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.panel-main h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.panel-side h2 {
  margin-top: 0;
}

canvas {
  max-width: 100%;
  height: auto;
  border-radius: 50%;
  background: radial-gradient(circle at center, #050711 0, #050711 55%, #000000 100%);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.time-summary {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.9;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

label {
  font-size: 0.85rem;
  opacity: 0.9;
}

select,
input[type="text"] {
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 10, 26, 0.95);
  color: #f5f7ff;
  font-size: 0.9rem;
  outline: none;
}

select:focus,
input[type="text"]:focus {
  border-color: #8ba7ff;
  box-shadow: 0 0 0 1px rgba(139, 167, 255, 0.7);
}

.hint {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0;
}

.primary-btn,
.secondary-btn {
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.primary-btn {
  background: linear-gradient(135deg, #4f5bff, #9b6bff);
  color: #fdfdff;
  box-shadow: 0 8px 20px rgba(79, 91, 255, 0.5);
}

.primary-btn:hover {
  filter: brightness(1.05);
}

.secondary-btn {
  background: rgba(18, 25, 60, 0.9);
  color: #e4e7ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.secondary-btn:hover {
  background: rgba(35, 45, 90, 0.95);
}

.info-block {
  margin-top: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.8rem;
  background: rgba(4, 7, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  line-height: 1.4;
  max-height: 260px;
  overflow-y: auto;
}

.info-block strong {
  color: #b6c5ff;
}

footer {
  padding: 0.6rem 1.5rem 0.9rem;
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.6;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
}


.info-dot {
  margin-left: 0.35rem;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  background: radial-gradient(circle at center, #ffd27f 0, #ff8bd1 50%, #4f5bff 100%);
  color: #050810;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  animation: info-pulse 1.8s ease-out infinite;
}

.info-dot:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 167, 255, 0.8);
}

@keyframes info-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

.info-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(5, 8, 16, 0.85), rgba(0, 0, 0, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.info-overlay.hidden {
  display: none;
}

.info-card {
  max-width: 420px;
  width: 90%;
  background: radial-gradient(circle at top, rgba(20, 26, 60, 0.96), rgba(6, 10, 30, 0.98));
  border-radius: 1.2rem;
  padding: 1rem 1.2rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.7);
  position: relative;
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.info-body {
  font-size: 0.88rem;
  line-height: 1.55;
}
.info-body p { margin: 0.4rem 0; }
.info-body ul { margin: 0.45rem 0 0.6rem 1.1rem; padding: 0; }
.info-body li { margin: 0.2rem 0; }
.info-body .muted { opacity: 0.9; }

.info-inline {
  margin-left: 6px;
  vertical-align: middle;
  animation: none;
  box-shadow: 0 0 0 0 rgba(255,255,255,0);
}

.details-tools{
  display:flex;
  justify-content:flex-end;
  margin:6px 0 8px 0;
}

/* Liens lexique (texte cliquable) */
.lex-link{
  border:none;
  background:transparent;
  color:#eaf0ff;
  font-weight:700;
  cursor:pointer;
  padding:0;
  text-decoration: underline;
  text-decoration-color: rgba(255, 210, 127, 0.6);
  text-underline-offset: 3px;
}
.lex-link:hover{ color:#ffd27f; }

/* Petit "i" pour ouvrir le lexique depuis une ligne */
.mini-i{
  margin-left: 6px;
  width: 16px;
  height: 16px;
  font-size: 10px;
  animation: none;
}

.info-close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  color: #f2f4ff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
}

.info-close:hover {
  color: #ffd27f;
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: 1.3rem;
  }
}


/* Anticipwa 25 – events panel */
.events-section{margin-top:14px;padding:12px;border:1px solid rgba(255,255,255,0.08);border-radius:10px;background:rgba(255,255,255,0.03)}
.events-section h4{margin:0 0 8px 0;font-size:1rem}
.events-list{margin:0;padding-left:18px}
.muted{opacity:0.85;font-size:0.92rem}
.code{white-space:pre-wrap;word-break:break-word;background:rgba(0,0,0,0.35);padding:10px;border-radius:10px;}


/* Expert / Observateur */
details.expert{margin:10px 0;padding:10px;border:1px solid rgba(255,255,255,0.12);border-radius:12px;background:rgba(255,255,255,0.03)}
details.expert summary{cursor:pointer;font-weight:600}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.row input{flex:1;min-width:140px}


/* --- Corpus / lexique --- */
.panel-details {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background: rgba(0,0,0,0.14);
}
.panel-details summary {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}
.lex-results {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.lex-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}
.lex-item:hover { background: rgba(255,255,255,0.08); }
.lex-item .lex-term { font-weight: 700; }
.lex-item .lex-meta { opacity: 0.8; font-size: 12px; white-space: nowrap; }
.lex-card { margin-top: 12px; }
.lex-card h4 { margin: 0 0 6px 0; }
.lex-card .muted { opacity: 0.8; }


/* ------------------------------
   Cadran : pédagogie & interaction
---------------------------------*/

.dial-bar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.chip-btn{
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(10,14,28,0.75);
  color:rgba(240,244,255,0.92);
  border-radius:999px;
  padding:7px 10px;
  font-size:0.92rem;
  cursor:pointer;
  transition:transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.chip-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(255,215,140,0.35);
  background:rgba(14,18,36,0.78);
}

.chip-btn[aria-pressed="false"]{
  opacity:0.78;
}

.dial-chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.dial-chip{
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(8,12,24,0.74);
  border-radius:14px;
  padding:8px 10px;
  min-width:160px;
}

.dial-chip .k{
  font-weight:700;
  font-size:0.92rem;
  margin-bottom:2px;
}

.dial-chip .v{
  font-size:0.92rem;
  opacity:0.92;
}

.dial-narration{
  margin-top:10px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(6,8,16,0.62);
  border-radius:16px;
  padding:10px 12px;
  line-height:1.35;
}

.dial-narration p{
  margin:0.4rem 0;
}

.dial-narration .focus-title{
  font-weight:800;
  margin-bottom:6px;
}

.dial-narration .muted{
  opacity:0.84;
}

/* Tour / parcours guidé */
.tour-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.62);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
  padding:18px;
}

/* IMPORTANT: permet de fermer réellement le parcours guidé */
.tour-overlay.hidden{
  display:none;
}

.tour-card{
  width:min(560px, 96vw);
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(6,8,16,0.92);
  border-radius:18px;
  padding:14px 14px 12px;
  box-shadow:0 18px 60px rgba(0,0,0,0.45);
}

.tour-title{
  font-weight:900;
  font-size:1.05rem;
  margin-bottom:8px;
}

.tour-text{
  opacity:0.92;
  line-height:1.45;
}

.tour-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:12px;
}



/* Forecast extras */
.events-sub { margin-top: 10px; }


/* Forecast extras: eclipses / journal / exports */

.forecast-grid{display:grid;grid-template-columns:1fr;gap:12px}
@media (min-width: 900px){.forecast-grid{grid-template-columns:1fr 1fr}}
.callout{border:1px solid rgba(255,255,255,0.15);border-radius:14px;padding:10px 12px;background:rgba(0,0,0,0.18);margin:10px 0}
.callout-title{font-weight:700;margin-bottom:6px}
.callout-body p{margin:6px 0}
.small{font-size:0.88em}
.journal-wrap textarea{width:100%;resize:vertical;min-height:110px}
.journal-row label{display:block;margin-bottom:6px}
.file-btn{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.journal-list{margin-top:10px}


/* Forecast settings */
.forecast-settings {
  margin: 10px 0 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.18);
}
.forecast-settings > summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
}
.forecast-settings .grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 10px;
}
.forecast-settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.84);
}
.forecast-settings input {
  width: 100%;
}
@media (max-width: 860px) {
  .forecast-settings .grid-2 { grid-template-columns: 1fr; }
}
.small { font-size: 0.85rem; }


/* Lexique – filtres sources */
.lex-filters{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  margin:10px 0 12px 0;
}
.lex-filter{
  display:flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,0.15);
  border-radius:999px;
  background: rgba(255,255,255,0.04);
  cursor:pointer;
  user-select:none;
  font-size:0.92rem;
}
.lex-filter input{ transform: translateY(0.5px); }
.lex-status{
  margin-left:auto;
  font-size:0.9rem;
  opacity:0.8;
}
.lex-section{ margin: 10px 0; }
.lex-section-title{ font-weight: 600; margin-bottom: 4px; opacity: 0.95; }
.lex-section-text{ opacity: 0.95; line-height: 1.45; }

@media (max-width: 520px){
  .lex-status{ margin-left:0; width:100%; }
}


/* --- Lexique : boutons du cadran --- */
.dial-chip-btn{
  cursor:pointer;
  text-align:left;
  appearance:none;
  color:inherit;
  font:inherit;
}
.dial-chip-btn:hover{
  transform: translateY(-1px);
}
.dial-chip-btn:active{
  transform: translateY(0px);
}
.dial-chip-btn:focus-visible{
  outline:2px solid rgba(255,255,255,0.55);
  outline-offset:2px;
}

.dial-lex-quick{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}

.mini-lex{
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(8,12,24,0.62);
  border-radius:999px;
  padding:6px 10px;
  cursor:pointer;
  appearance:none;
  color:inherit;
  font:inherit;
  font-size:0.86rem;
}
.mini-lex:hover{
  transform: translateY(-1px);
}
.mini-lex:focus-visible{
  outline:2px solid rgba(255,255,255,0.55);
  outline-offset:2px;
}
