:root {
  --bg-1: #64706B;
  --bg-2: #dff2ec;
  --bg-3: #c9e8df;
  --surface: #ffffff;
  --surface-soft: #f4fbf8;
  --line: #d4e7e0;
  --text: #1d2d29;
  --muted: #5f7a73;
  --accent: #4f9f8f;
  --accent-strong: #3d8778;
  --accent-soft: #deefe9;
  --danger-bg: #fff2ee;
  --danger-text: #9a3f32;
  --shadow: 0 14px 34px rgba(39, 92, 79, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-1);
  background-image:
    radial-gradient(900px 560px at 8% -4%, rgba(121, 196, 180, 0.28), transparent 60%),
    radial-gradient(860px 620px at 100% 0%, rgba(179, 225, 213, 0.34), transparent 60%);
  background-attachment: fixed;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  color: #522020;
}

h1 {
  font-size: 1.55rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.05rem;
}

.sub,
.muted,
.small,
.meta,
.source,
.pager .info {
  color: white;
}

.wrap {
  max-width: 1100px;
  margin: 18px auto 64px;
  padding: 0 16px;
}

.top-home {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(29, 45, 41, 0.14);
  background: linear-gradient(140deg, #5ea896, #4f9f8f);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(49, 104, 90, 0.24);
}

.home-link:hover {
  color: #ffffff;
  text-decoration: none;
  filter: brightness(1.04);
}

.card,
.panel,
form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card,
.panel {
  padding: 14px;
}

.card {
  margin-bottom: 14px;
}

form {
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row,
.field,
.formline,
.actions,
.options,
.check,
.toggle,
.topline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field,
.formline {
  width: 100%;
}

form.search {
  padding: 16px;
}

.card > form,
.panel > form {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

input,
select,
button,
a.btn,
.btn,
.pbtn,
.read-more,
.modal-close,
.modal .close {
  font: inherit;
}

input[type="text"],
select,
textarea {
  width: 100%;
  min-width: 180px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
}

input::placeholder {
  color: #7f9992;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(79, 159, 143, 0.62);
  box-shadow: 0 0 0 4px rgba(79, 159, 143, 0.16);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--accent);
}

button,
.btn,
a.btn,
.pbtn,
.read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(79, 159, 143, 0.42);
  background: linear-gradient(140deg, #6ab4a3, #4f9f8f);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

button:hover,
.btn:hover,
a.btn:hover,
.pbtn:hover,
.read-more:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

button:active,
.btn:active,
a.btn:active,
.pbtn:active,
.read-more:active {
  transform: translateY(1px);
}

.btn.secondary,
.btn-secondary,
a.btn.secondary {
  border-color: rgba(29, 45, 41, 0.16);
  background: #ebf6f2;
  color: #2d6f61;
}

.btn.disabled,
a.btn.disabled,
.pbtn.disabled,
[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.option-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.btn-random {
  margin-left: auto;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  font-size: 0.92rem;
}

.results,
.list,
.grid {
  margin-top: 12px;
}

.results,
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(30, 80, 68, 0.08);
  padding: 14px;
}

.result-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.result-item:last-child {
  border-bottom: none;
}

.mot {
  font-size: 1.06rem;
  font-weight: 780;
  margin: 0 0 8px;
}

.excerpt,
.quote,
.corpus,
pre {
  line-height: 1.58;
}

.excerpt,
.quote {
  margin: 0;
}

.excerpt,
.page-citations .card,
.page-notide .modal-body,
pre {
  text-align: justify;
}

.definition {
  margin-top: 10px;
}

.definition-view section.definition,
.definition-view .definition,
.corpus {
  margin-top: 10px;
  white-space: pre-wrap;
}

.page-larousse .corpus.full {
  display: none;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(79, 159, 143, 0.3);
  background: var(--accent-soft);
  color: #24685b;
  font-size: 0.83rem;
  font-weight: 700;
}

.check,
.toggle,
.options label {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

th,
td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

th {
  border-top: none;
  text-align: left;
  color: var(--muted);
  font-weight: 800;
  background: var(--surface-soft);
}

tr:hover td {
  background: #edf7f4;
}

.rowlink {
  cursor: pointer;
}

mark {
  background: #d6f1e8;
  color: #1e4f45;
  padding: 0 3px;
  border-radius: 4px;
}

.pagination,
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.pager {
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(79, 159, 143, 0.34);
  background: #eef8f4;
  color: #2e6f61;
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 700;
}

.pager a.current {
  background: #dff1ea;
  border-color: rgba(79, 159, 143, 0.66);
}

.error,
.err {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #f0c8bd;
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 12px 14px;
}

.empty {
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(16, 44, 37, 0.38);
  z-index: 9999;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(960px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 78px rgba(19, 56, 47, 0.24);
  padding: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  margin: -14px -14px 0;
  padding: 12px 14px;
  background: #eef8f4;
}

.modal-title {
  margin: 0;
  font-weight: 800;
}

.modal-body {
  padding-top: 14px;
  white-space: pre-wrap;
}

.modal .close,
.modal-close {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 700;
  cursor: pointer;
}

.modal .close {
  float: right;
  margin-bottom: 8px;
}

.noticeBox {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcfa;
  padding: 10px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  hyphens: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.filelist {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.filelist li {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 8px 10px;
}

.filemeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.mt-10 {
  margin-top: 10px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-14 {
  margin-top: 14px;
}

.page-larousse .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.page-notide .item .actions {
  margin-top: 8px;
}

.page-citations header {
  margin-bottom: 12px;
}

.page-citations form {
  align-items: flex-start;
}

.page-citations .field input[type="text"] {
  flex: 1 1 24rem;
  width: min(35ch, 100%);
}

.page-citations .field select {
  flex: 0 0 auto;
  min-width: 170px;
}

.page-citations .panel.empty p {
  margin: 0;
}

.page-films .formline {
  flex-wrap: nowrap;
}

.page-films .formline input[name="q"] {
  width: 420px;
  max-width: 420px;
}

.page-films .pagination {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .page-films .formline {
    flex-wrap: wrap;
  }

  .page-films .formline input[name="q"] {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 12px;
  }

  .field,
  .formline {
    flex-direction: column;
    align-items: stretch;
  }

  .field input[type="text"],
  .field select,
  .btn,
  a.btn,
  button {
    width: 100%;
  }

  .btn-random {
    margin-left: 0;
  }

  .pager {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .page-films .formline a.btn {
    width: auto;
    align-self: flex-start;
  }

  .page-films table,
  .page-films thead,
  .page-films tbody,
  .page-films th,
  .page-films td,
  .page-films tr {
    display: block;
  }

  .page-films thead {
    display: none;
  }

  .page-films tr {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
  }

  .page-films td {
    border-top: none;
    padding: 6px 0;
  }

  .page-films td:nth-child(1)::before {
    content: "Film";
  }

  .page-films td:nth-child(2)::before {
    content: "Annee";
  }

  .page-films td:nth-child(3)::before {
    content: "Titre normalise";
  }

  .page-films td:nth-child(4)::before {
    content: "Extrait (notice)";
  }

  .page-films td::before {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2px;
  }

  .page-films tr:hover td {
    background: transparent;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 1.3rem;
  }

  .modal {
    padding: 12px;
  }

  pre {
    padding: 8px;
  }
}
