
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: sans-serif;
  //max-width: 1100px;
  display: block;
  height: auto;
  margin: 1rem auto;
  padding: 0 1rem;
  background: #faf9f7;
  color: #222;
}

html, body {
  height: auto;
  min-height: 100%; !important;
  overflow: visible !important;
  overflow-x: hidden;
}

h1 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* ───────────────────────────── */
/* Responsive layout */
/* ───────────────────────────── */

.controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meters-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.meters-row label {
  min-width: 120px;
  font-size: .85rem;
  font-weight: 600;
  color: #555;
  padding-top: .45rem;
}

.meters-col {
  flex: 1;
  min-width: 0;
}

#meters_input,
#poeme_input,

#output {
  width: 100%;
  font-family: monospace;
  font-size: 12px;
  padding: .55rem .7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  
  max-height: none;
  overflow: visible;

}

/* helper to see blocks
 * {
  outline: 1px solid rgba(255,0,0,0.1);
}*/

#poeme_input {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
}

.meters-hint {
  margin-top: .4rem;
  font-size: .74rem;
  color: #777;
  line-height: 1.5;
}

.meters-hint code {
  background: #eee;
  padding: 0 .25rem;
  border-radius: 2px;
}

/* ───────────────────────────── */
/* Toolbar */
/* ───────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.action-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}

/* ───────────────────────────── */
/* Toggle switch */
/* ───────────────────────────── */

.mode-toggle {
  display: inline-flex;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  overflow: hidden;
  background: white;
}

.mode-toggle button {
  border: none;
  background: transparent;
  padding: .45rem .9rem;
  cursor: pointer;
  font-size: .82rem;
  transition: .15s;
}

.mode-toggle button.active {
  background: #4a7c59;
  color: white;
}

/* ──────────────────────────────────── */
/* format exposant utilisé pour types de Césures  */
/* ──────────────────────────────────── */

sup {
  vertical-align: super;
  font-size: 0.7em;
  line-height: 0;
}

/* ───────────────────────────── */
/* Bouton */
/* ───────────────────────────── */

#btn_process {
  padding: .55rem 1.4rem;
  border: none;
  border-radius: 6px;
  background: #4a7c59;
  color: white;
  cursor: pointer;
  font-size: .9rem;
}

#btn_process:disabled {
  opacity: .7;
  cursor: wait;
}

/* ───────────────────────────── */
/* Status */
/* ───────────────────────────── */

#status {
  font-size: .85rem;
  color: #666;
  white-space: nowrap;
}

/* ───────────────────────────── */
/* Output */
/* ───────────────────────────── */

#output {
  margin-top: 1rem;
  white-space: pre-wrap;
  font-family: monospace;
  background: #f4f3f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  line-height: 1.8;

  overflow-y: auto;

  min-height: 120px;
  //max-height: 70vh;

  scroll-behavior: smooth;
}

/* Ligne active */
.current-line {
  background: rgba(74,124,89,.12);
  border-radius: 4px;
  display: inline;
}

/* Coloration genre */
.vf {
  color: #8b5e00;
  font-weight: 600;
}

.vm {
  color: #2a5f3f;
  font-weight: 600;
}

/* ── Légende ── */
.legend {
  margin-top: .7rem;
  font-size: .72rem;
  color: #888;
  line-height: 1.7;
}

.legend .lf {
  color: #8b5e00;
  font-weight: 600;
}

.legend .lm {
  color: #2a5f3f;
  font-weight: 600;
}

/* ───────────────────────────── */
/* Mobile */
/* ───────────────────────────── */

@media (max-width: 700px) {

  body {
    padding: 0 .75rem;
  }

  .meters-row {
    flex-direction: column;
    gap: .35rem;
  }

  .meters-row label {
    padding-top: 0;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-row {
    width: 100%;
  }

  #btn_process {
    width: 100%;
  }

  #status {
    white-space: normal;
  }
}

.examples-wrapper select {

  padding: .5rem .75rem;

  border-radius: 6px;

  border: 1px solid #ccc;

  background: white;

  font-size: .85rem;

  cursor: pointer;
}

.footer-links {

  margin-top: 1rem;

  font-size: .85rem;
}

.footer-links a {

  color: #4a7c59;

  text-decoration: none;
}

.footer-links a:hover {

  text-decoration: underline;
}

/* ───────────────────────────── */
/* Couleurs des lettres en sortie.        */
/* ───────────────────────────── */

.ansi-red {
  color: #cc3333;
  font-weight: 600;
}

.ansi-magenta {
  color: #a020f0;
  font-weight: 600;
}

.ansi-orange {
  color: #c87000;
  font-weight: 700;
}

/* ───────────────────────────── */
/* Lignes commentaires (#)       */
/* ───────────────────────────── */

.comment-line {
  color: #999;
  font-style: italic;
}

/* ─────────────────────────────── */
/* Césure controls                 */
/* ─────────────────────────────── */
.cesure-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  margin-top: .35rem;
}
.cesure-row label.row-label {
  min-width: 120px;
  font-size: .85rem;
  font-weight: 600;
  color: #555;
  padding-top: .45rem;
}
.cesure-col {
  flex: 1;
  min-width: 0;
}
.cesure-options {
  margin-top: .4rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  font-size: .82rem;
  color: #555;
}
.cesure-options label {
  display: flex;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  user-select: none;
}
.cesure-bar {
  color: #2a6e3f;
  font-weight: 700;
}
.cesure-double {
  letter-spacing: -1px;
}
.cesure-bar-missing {
  color: #cc3333;
  font-weight: 700;
}
/* ───────────────────────────── */
/* Exposants de genre hémistiche */
/* ───────────────────────────── */

.hemi-m {
  font-size: .62em;
  vertical-align: super;
  color: #2a5f3f;
  font-weight: 700;
  letter-spacing: 0;
}

.hemi-f {
  font-size: .62em;
  vertical-align: super;
  color: #8b5e00;
  font-weight: 700;
  letter-spacing: 0;
}

/* Superscripts de type de césure (ᴱ ᴵ ᴸ) */
.cesure-type {
  font-size: .7em;
  vertical-align: super;
  font-weight: 700;
}

/* Superscripts de type césure (E, I, L) dans la barre verte */
.cesure-bar .cesure-type {
  color: inherit;
  font-size: .65em;
  vertical-align: super;
  font-weight: 700;
}

/* Superscripts de type césure (E, I, L) dans la barre rouge */
.ansi-red .cesure-type {
  color: inherit;
  font-size: .65em;
  vertical-align: super;
  font-weight: 700;
}

/* e non-autonome orthographique (pensée, comblée…) */
.e-ortho {
  color: #888;
  font-style: italic;
}

.ansi-cesure {
  color: #2a6e3f;
  font-weight: 700;
}