/* Palette / typo reprises de it-log-one.fr */
:root {
  color-scheme: light dark;
  --ilo-navy: #0b2240;
  --ilo-text: #1a2733;
  --ilo-accent: #35b6e8;
  --ilo-link: #1577c2;
  --ilo-bg-alt: #f5f8fb;
  font-family: "Inter", system-ui, sans-serif;
}

body {
  margin: 0;
  padding: 0 24px 32px;
  max-width: 1200px;
  margin-inline: auto;
  color: var(--ilo-text);
  background: #fff;
}

/* .controls/.output-header etc. set display:flex at the same specificity as the browser's own
   [hidden] rule — same-specificity ties go to the LAST author rule, which without this override
   is ours, so an element could have the hidden attribute and still render as flex. */
[hidden] {
  display: none !important;
}

h1, h2 {
  font-family: "Georama", system-ui, sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--ilo-navy);
  color: #fff;
  margin: 0 -24px 24px;
  padding: 20px 24px;
  border-radius: 0 0 8px 8px;
}

.site-header .logo {
  height: 48px;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.site-header p {
  margin: 0;
  color: #cfe3f5;
  font-size: 14px;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.input-panel, .output-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Textarea + highlight overlay stacked exactly on top of each other: the <pre> underneath shows
   colored spans, the textarea on top has transparent text (but a visible caret) so typing still
   feels native — classic "poor man's syntax highlighting" for a plain <textarea>. */
.code-editor {
  position: relative;
  height: 420px;
}

.code-editor textarea,
.code-editor pre {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #c7d2dd;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
}

.code-editor textarea {
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--ilo-text);
  z-index: 1;
}

.code-editor pre {
  background: #fff;
  pointer-events: none;
  z-index: 0;
}

.tok-cmd {
  color: var(--ilo-link);
  font-weight: 600;
}

.tok-fd {
  color: #1a7a3a;
}

.controls, .export-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-label {
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #c7d2dd;
  border-radius: 4px;
  background: #fff;
}

.file-label:hover {
  background: var(--ilo-bg-alt);
}

select:disabled, input:disabled {
  background: #eceff2;
  color: #8a97a3;
  cursor: not-allowed;
}

label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hint {
  font-size: 12px;
  color: #7a8794;
  margin: 0;
}

input[type="number"] {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #c7d2dd;
  border-radius: 4px;
}

select {
  padding: 6px 8px;
  border: 1px solid #c7d2dd;
  border-radius: 4px;
}

.btn {
  padding: 9px 22px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  transition: opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-primary {
  background: var(--ilo-navy);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  background: #fff;
  color: var(--ilo-navy);
  border: 1px solid #c7d2dd;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--ilo-bg-alt);
}

.btn-accent {
  background: var(--ilo-accent);
  color: var(--ilo-navy);
}

.btn-accent:hover:not(:disabled) {
  opacity: 0.85;
}

.error {
  color: #c0392b;
  white-space: pre-wrap;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8ef;
}

#labels-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ilo-navy);
}

#labels-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.label-card {
  border: 1px solid #dde4ec;
  background: var(--ilo-bg-alt);
  border-radius: 6px;
  padding: 12px;
}

.label-image {
  display: flex;
  justify-content: center;
  /* Rotation overflows the image's own layout box — this lets it show fully instead of clipping. */
  overflow: visible;
  padding: 12px 0;
}

.label-card img {
  max-width: 100%;
  background: white;
  border-radius: 4px;
  transition: transform 0.15s;
}

.label-meta {
  font-size: 12px;
  color: #55606b;
  margin-top: 8px;
}

.label-warning {
  font-size: 12px;
  color: #b8860b;
  margin-top: 4px;
}
