:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --accent: #2563eb;
  --text: #1f2937;
  --muted: #6b7280;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

header {
  background: #0f172a;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1.3rem;
  margin: 0;
}

header input {
  max-width: 280px;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 6px;
}

main {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.3);
  overflow: hidden;
}

.section-header {
  background: rgba(37, 99, 235, 0.08);
  padding: 0.6rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.section-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.badge {
  background: rgba(15, 23, 42, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

.content {
  padding: 0.6rem 0.9rem 0.8rem;
}

.item {
  margin-bottom: 0.55rem;
}

.item-title {
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.item-desc {
  font-size: 0.7rem;
  color: var(--muted);
}

.link {
  font-size: 0.7rem;
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.link:hover {
  text-decoration: underline;
}

code {
  background: rgba(15, 23, 42, 0.05);
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.7rem;
}

/* imprime pas la barre de recherche */
@media print {
  body {
    background: white;
  }
  header input {
    display: none;
  }
  main {
    gap: 0.8rem;
  }
  .section {
    box-shadow: none;
  }
  a.link {
    word-break: break-word;
  }
}

/* tickets */
.ticket-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.ticket-list li {
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  line-height: 1.3;
}
.ticket-list strong {
  color: #1f2937;
}
.ticket-list a {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
}
.ticket-list a:hover {
  text-decoration: underline;
}

/* galleries (calmcodes + rooting) */
.calmcodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.9rem;
}
.calmcard {
  background: rgba(15, 23, 42, 0.015);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 0.35rem 0.35rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.calmcard:hover {
  transform: scale(1.03);
}
.calm-caption {
  font-size: 0.65rem;
  color: #374151;
  margin-bottom: 0.3rem;
  font-weight: 600;
  word-break: break-all;
}
.calm-img-wrapper {
  background: white;
  border-radius: 6px;
  padding: 0.25rem;
  max-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.calm-img-wrapper img {
  max-width: 100%;
  height: auto;
}

/* lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
}
.close-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #333;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}
.close-lightbox:hover {
  color: #666;
}
.lightbox p {
  color: #333;
  font-size: 0.8rem;
  margin-top: 10px;
  word-break: break-all;
}
