/* Carnet d'adresses Royal Cheese — one file, no build step (DESIGN.md §9). */

:root {
  --accent: #1a56b0;        /* the single accent colour */
  --accent-dark: #143f82;
  --danger: #b3261e;        /* red: delete button only */
  --danger-dark: #8c1c16;
  --text: #1c1c1c;
  --muted: #555;
  --line: #d9d9d9;
  --soft: #f3f4f6;
  --warn-bg: #fff4d6;
  --warn-line: #e5c56a;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.site-nav { font-size: 0.9rem; color: var(--muted); }
.site-nav a { color: var(--accent); text-decoration: none; }
.site-nav a:hover, .site-nav a:focus { text-decoration: underline; }

.page { max-width: 900px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

h1 { font-size: 1.8rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.25rem; }
p { margin: 0.5rem 0 0.75rem; }
.lead { font-size: 1.1rem; }
.small, .hint { font-size: 0.9rem; color: var(--muted); }
.big { font-size: 2rem; font-weight: 700; margin: 1rem 0 0.25rem; }
a { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--soft);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

section { margin-bottom: 1.5rem; }
ul.headers, ul.columns, ul.compteurs { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; }
ul.columns { columns: 2; column-gap: 2rem; }
ul.compteurs { list-style: none; padding-left: 0; }

.banner {
  background: var(--soft);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}
.banner-warning { background: var(--warn-bg); border-left-color: var(--warn-line); }
.statut p { margin: 0.25rem 0; }

/* Buttons: large targets, high contrast. */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  line-height: 1.2;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--soft); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover, .btn-danger:focus { background: var(--danger-dark); border-color: var(--danger-dark); }
.btn:focus-visible { outline: 3px solid #000; outline-offset: 2px; }

.actions { margin: 1.5rem 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions form { display: inline; }
.actions-block { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.bloc { padding: 1rem 0; border-top: 1px solid var(--line); }
.bloc .actions { margin: 0.25rem 0 0.5rem; }

/* Progress bar */
.bar { height: 18px; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin: 1rem 0; }
.bar-fill { height: 100%; background: var(--accent); transition: width 1s linear; }

/* Search */
.recherche { display: flex; flex-direction: column; gap: 0.25rem; margin: 1.5rem 0; }
.recherche input {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  max-width: 480px;
}
.recherche input:focus { border-color: var(--accent); outline: none; }

/* Tables scroll inside their container on small screens. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
td.tick input { width: 1.6rem; height: 1.6rem; }
.tick-target { display: block; padding: 0.75rem; margin: -0.55rem -0.6rem; cursor: pointer; }
td.email, td.date, td.num { white-space: nowrap; }
td.objets { min-width: 16rem; max-width: 26rem; }
td.objets details { margin-top: 0.25rem; font-size: 0.9rem; }
td.objets ul { margin: 0.25rem 0; padding-left: 1rem; }
td.voir { white-space: nowrap; }
table.brut td, table.journal td { font-size: 0.88rem; word-break: break-word; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.tag-shared { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }

.partie { margin-top: 2rem; }
.partie summary { font-size: 1.3rem; font-weight: 700; cursor: pointer; padding: 0.5rem 0; }
.summary-title { display: inline; font-size: inherit; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-tools { font-size: 0.9rem; }
.closing { margin-top: 2rem; font-weight: 600; }

.prose { max-width: 720px; }
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.25rem; }
.prose table { width: auto; }

@media (max-width: 600px) {
  html { font-size: 16px; }
  .btn { width: 100%; text-align: center; }
  .actions form { display: block; width: 100%; }
  td.objets { min-width: 12rem; }
  ul.columns { columns: 1; }
}
