/* bigdata.wolutions.fr — charte Wolutions */
:root {
  --ink: #14181B;
  --ink-2: #2A3034;
  --magenta: #E4155C;
  --magenta-soft: #FCE4EC;
  --teal: #229CA3;
  --teal-deep: #5E9C9A;
  --teal-soft: #DDF1F2;
  --sage: #D5E3D4;
  --paper: #EEF1EE;
  --line: #D8E0D8;
  --white: #FFFFFF;
  --muted: #5F6B66;
  --off: #B7C1BB;          /* icônes non utilisées */
  --amber: #E89B12;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 24, 27, .05), 0 6px 22px -12px rgba(20, 24, 27, .18);
  --f-title: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --tabbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--magenta); color: #fff; box-shadow: 0 6px 16px -8px rgba(228, 21, 92, .7); }
.btn-primary:hover { background: #C90F4F; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-danger { background: transparent; color: var(--magenta); border-color: transparent; padding: 0 10px; }
.btn-danger:hover { background: var(--magenta-soft); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.iconbtn:hover { background: var(--paper); color: var(--ink); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(20px, env(safe-area-inset-left)) 12px max(20px, env(safe-area-inset-right));
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt b { font: 800 21px/1 var(--f-title); letter-spacing: -.02em; }
.brand-txt small { font: 500 11px/1.4 var(--f-mono); color: var(--teal); letter-spacing: .08em; text-transform: uppercase; }
.mainnav { display: flex; gap: 6px; margin-right: auto; }
.mainnav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  text-decoration: none; font-weight: 600; color: var(--muted);
}
.mainnav a:hover { background: var(--paper); color: var(--ink); }
.mainnav a.on { background: var(--ink); color: #fff; }
.count { font: 500 12px var(--f-mono); padding: 1px 8px; border-radius: 99px; background: var(--magenta); color: #fff; }
.count:empty { display: none; }
.soon { font: 500 10.5px var(--f-mono); padding: 2px 7px; border-radius: 99px; background: var(--sage); color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.mainnav a.on .soon { background: rgba(255,255,255,.18); color: #fff; }

/* barre d'onglets mobile */
.tabbar { display: none; }

/* ---------------------------------------------------------------- page */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.toolbar { display: flex; gap: 14px; align-items: center; }
.actions { display: flex; gap: 10px; margin-left: auto; }

.search { position: relative; flex: 1; max-width: 560px; }
.search > .i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 44px 0 46px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--white); outline: none; font-size: 15.5px;
  transition: border-color .15s, box-shadow .15s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(34, 156, 163, .14); }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.search-clear:hover { background: var(--paper); }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px -18px rgba(20,24,27,.35);
  overflow: hidden; max-height: min(70vh, 520px); overflow-y: auto;
}
.sg-item { display: flex; gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--paper); }
.sg-item:last-child { border-bottom: 0; }
.sg-item.on, .sg-item:hover { background: var(--teal-soft); }
.sg-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--teal); flex: none; }
.sg-ico .i { width: 18px; height: 18px; }
.sg-main { min-width: 0; flex: 1; }
.sg-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-field { font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--teal); background: var(--teal-soft); padding: 2px 7px; border-radius: 6px; flex: none; }
.sg-item.on .sg-field { background: #fff; }
.sg-empty, .sg-more { padding: 14px 16px; color: var(--muted); font-size: 14px; }
.sg-more { background: var(--paper); font-weight: 600; color: var(--ink); cursor: pointer; display: flex; align-items: center; gap: 8px; }
mark { background: rgba(228, 21, 92, .14); color: inherit; border-radius: 3px; padding: 0 1px; }

.listbar { display: flex; align-items: center; gap: 12px; margin: 22px 2px 14px; flex-wrap: wrap; }
.stats { margin: 0; font: 500 12.5px var(--f-mono); color: var(--muted); letter-spacing: .02em; }
.stats b { color: var(--ink); font-weight: 500; }
.stats .due { color: var(--magenta); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
.filter-chip button { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 24px; height: 24px; border-radius: 99px; cursor: pointer; display: grid; place-items: center; }
.filter-chip .i { width: 14px; height: 14px; }
.sort { margin-left: auto; }
.sort select { height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); padding: 0 30px 0 12px; font-size: 13.5px; color: var(--ink); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6B66' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }

/* ---------------------------------------------------------------- tuiles */
.tiles { display: grid; gap: 14px; }
.tile {
  position: relative; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(216, 224, 216, .7); overflow: hidden;
  animation: rise .28s ease both;
}
.tile::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
.tile.flash { animation: flash 1.6s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--magenta), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.skeleton { height: 150px; background: linear-gradient(90deg, #fff 0%, #F5F7F5 50%, #fff 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton::before { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

.tile-head { display: flex; align-items: flex-start; gap: 16px; padding: 18px 18px 14px 26px; }
.tile-id { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.tile-name { margin: 0; font: 700 21px/1.2 var(--f-title); letter-spacing: -.015em; overflow-wrap: anywhere; }
.tile-name.is-blank { color: var(--off); font-style: italic; font-weight: 500; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; background: var(--sage); font: 500 12px var(--f-mono); color: var(--ink); white-space: nowrap; }
.pill.none { background: transparent; border: 1px dashed var(--off); color: var(--muted); }
.tile-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; color: var(--muted); max-width: 44%; text-align: right; padding-top: 2px; }
.tile-meta a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; overflow-wrap: anywhere; }
.tile-meta a:hover { color: var(--teal); }
.tile-meta .i { width: 15px; height: 15px; color: var(--teal-deep); }
.tile-tools { display: flex; gap: 2px; margin: -6px -6px 0 0; }

.contacts { list-style: none; margin: 0; padding: 0 10px 8px 18px; }
.contact {
  display: grid; grid-template-columns: 40px minmax(150px, 1.3fr) minmax(130px, .9fr) minmax(160px, 1.2fr) auto;
  gap: 14px; align-items: center; padding: 10px 8px; border-top: 1px dashed var(--line);
}
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 14px var(--f-title); letter-spacing: .02em; }
.contact:nth-child(3n+2) .avatar { background: var(--teal); }
.contact:nth-child(3n+3) .avatar { background: var(--magenta); }
.c-who { min-width: 0; cursor: pointer; border-radius: 8px; }
.c-who:hover .c-name { color: var(--teal); }
.c-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-name.is-blank { color: var(--off); font-style: italic; font-weight: 500; }
.c-job { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-link { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font: 400 13.5px var(--f-mono); text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; }
.c-link span { overflow: hidden; text-overflow: ellipsis; }
.c-link .i { width: 16px; height: 16px; color: var(--teal-deep); }
.c-link:hover { color: var(--teal); }
.c-link.is-blank { color: var(--off); }
.c-link.is-blank .i { color: var(--off); }
.c-icons { display: flex; gap: 4px; }
.ci {
  position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--off); transition: background .15s, color .15s, transform .12s;
}
.ci:hover { background: var(--paper); color: var(--muted); }
.ci:active { transform: scale(.92); }
.ci.on.notes { color: var(--teal); background: var(--teal-soft); }
.ci.on.card { color: var(--ink); background: var(--sage); }
.ci.on.bell { color: var(--amber); background: #FFF3DC; }
.ci.on.bell.due { color: #fff; background: var(--magenta); }
.ci.on.bell.due::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 99px; background: #fff; border: 2px solid var(--magenta); }

.tile-foot { display: flex; gap: 8px; padding: 4px 18px 14px 26px; }
.add-contact { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--teal); font-weight: 600; font-size: 13.5px; padding: 6px 8px; margin-left: -8px; border-radius: 8px; cursor: pointer; }
.add-contact:hover { background: var(--teal-soft); }
.add-contact .i { width: 17px; height: 17px; }
.no-contact { padding: 6px 26px 4px; color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- vide */
.empty { text-align: center; padding: 56px 20px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty h2 { font: 700 24px var(--f-title); margin: 18px 0 6px; }
.empty p { color: var(--muted); margin: 0 auto 22px; max-width: 420px; }
.empty-art { width: 84px; height: 84px; margin: 0 auto; border-radius: 26px; display: grid; place-items: center; background: var(--ink); color: #fff; }
.empty-art .i { width: 40px; height: 40px; }
.empty .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.soon-page { margin-top: 30px; }

/* ---------------------------------------------------------------- modales */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 24, 27, .46);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 620px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; background: var(--white); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(20, 24, 27, .5); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.wide { max-width: 880px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px 24px; border-bottom: 1px solid var(--paper); }
.modal-head h2 { margin: 0; font: 700 20px/1.25 var(--f-title); letter-spacing: -.01em; flex: 1; min-width: 0; }
.modal-head h2 small { display: block; font: 500 12.5px var(--f-body); color: var(--muted); margin-top: 2px; }
.modal-body { padding: 18px 24px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px 18px; border-top: 1px solid var(--paper); }
.modal-foot .spacer { flex: 1; }

.section-t { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font: 500 11.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.section-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-t .i { width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2 .full { grid-column: 1 / -1; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1.5px solid var(--line);
  background: #FBFCFB; outline: none; font-size: 15px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { height: auto; min-height: 80px; padding: 10px 13px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(34, 156, 163, .12); }
.field input.ai { border-color: rgba(34, 156, 163, .55); background: #F3FBFB; }
.field .was { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .was button { border: 0; background: none; color: var(--teal); font-weight: 600; cursor: pointer; padding: 0; font-size: 12px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--magenta-soft); color: #9B0D3D; font-size: 14px; margin-bottom: 14px; }
.alert .i { margin-top: 1px; }
.alert.info { background: var(--teal-soft); color: #11666B; }
.alert.warn { background: #FFF3DC; color: #7A4F00; }

/* doublons */
.dups { border: 1.5px solid var(--amber); border-radius: 16px; padding: 14px; margin-bottom: 18px; background: #FFFBF2; }
.dups h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 700 16px var(--f-title); color: #7A4F00; }
.dup-opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); margin-top: 8px; cursor: pointer; }
.dup-opt:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(34, 156, 163, .12); }
.dup-opt input { margin-top: 3px; accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.dup-opt b { display: block; }
.dup-opt small { color: var(--muted); display: block; font-size: 12.5px; }
.reasons { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.reasons span { font: 500 11px var(--f-mono); padding: 1px 7px; border-radius: 6px; background: var(--paper); color: var(--ink); }
.score { margin-left: auto; font: 500 12px var(--f-mono); color: var(--teal); flex: none; }

/* import carte */
.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drop {
  position: relative; border: 2px dashed var(--line); border-radius: 16px; background: #FBFCFB; min-height: 168px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center;
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop.has { border-style: solid; border-color: var(--teal); padding: 8px; }
.drop-t { font: 700 15px var(--f-title); }
.drop-t small { display: block; font: 400 12.5px var(--f-body); color: var(--muted); }
.drop-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.drop img { width: 100%; max-height: 190px; object-fit: contain; border-radius: 10px; background: var(--paper); }
.drop .filebox { display: flex; align-items: center; gap: 10px; padding: 18px; font-weight: 600; }
.drop .rm { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 99px; border: 0; background: rgba(20,24,27,.75); color: #fff; display: grid; place-items: center; cursor: pointer; }
.drop .rm .i { width: 16px; height: 16px; }
.hint { font-size: 13px; color: var(--muted); margin: 12px 2px 4px; display: flex; gap: 8px; align-items: flex-start; }
.hint .i { width: 17px; height: 17px; color: var(--teal); margin-top: 1px; }

.reading { text-align: center; padding: 34px 10px 30px; }
.reading .orb { width: 92px; height: 92px; margin: 0 auto 18px; position: relative; }
.reading .orb img { width: 100%; height: 100%; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reading h3 { font: 700 19px var(--f-title); margin: 0 0 4px; }
.reading p { color: var(--muted); margin: 0; }

.thumbs { display: flex; gap: 10px; margin-bottom: 16px; }
.thumbs a, .thumbs div { flex: 1; max-width: 50%; }
.thumbs img { width: 100%; max-height: 120px; object-fit: contain; border-radius: 10px; background: var(--paper); display: block; }

.card-view { display: grid; gap: 14px; }
.card-view figure { margin: 0; }
.card-view figcaption { font: 500 11.5px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--teal); margin-bottom: 6px; }
.card-view img { width: 100%; border-radius: 14px; background: var(--paper); display: block; }
.card-view .pdf { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 14px; background: var(--paper); text-decoration: none; font-weight: 600; }

/* éditeur */
.rte { border: 1.5px solid var(--line); border-radius: 14px; background: #fff; display: flex; flex-direction: column; min-height: 0; }
.rte:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(34, 156, 163, .12); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--paper); position: sticky; top: 0; background: #fff; border-radius: 14px 14px 0 0; z-index: 1; }
.rte-bar button { min-width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 0 8px; font-size: 14.5px; }
.rte-bar button:hover { background: var(--paper); }
.rte-bar button.on { background: var(--ink); color: #fff; }
.rte-bar .sep { width: 1px; background: var(--line); margin: 6px 4px; }
.rte-bar .i { width: 18px; height: 18px; }
.rte-area { min-height: 46vh; padding: 16px 18px; outline: none; font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; }
.rte-area:empty::before { content: attr(data-ph); color: var(--off); }
.rte-area h2 { font: 700 20px var(--f-title); margin: .6em 0 .3em; }
.rte-area h3 { font: 700 17px var(--f-title); margin: .6em 0 .3em; }
.rte-area blockquote { margin: .5em 0; padding: 4px 14px; border-left: 3px solid var(--teal); color: var(--muted); }
.rte-area a { color: var(--teal); }
.rte-area p { margin: 0 0 .5em; }
.save-state { font: 500 12px var(--f-mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state.ok { color: var(--teal); }
.save-state .i { width: 15px; height: 15px; }

.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.quick button { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.quick button:hover { border-color: var(--teal); color: var(--teal); }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top, 0px)); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 500; box-shadow: 0 14px 40px -14px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: center; animation: pop .22s ease; pointer-events: auto; }
.toast .i { color: var(--teal); }
.toast.err .i { color: var(--magenta); }

/* ---------------------------------------------------------------- installation (mobile) */
.install {
  position: fixed; z-index: 90; left: 12px; right: 12px; bottom: calc(12px + var(--tabbar-h) + var(--safe-b));
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px;
  background: var(--ink); color: #fff; box-shadow: 0 18px 50px -12px rgba(0,0,0,.55); animation: pop .3s ease;
}
.install img { border-radius: 11px; background: #fff; }
.install-txt { flex: 1; min-width: 0; line-height: 1.3; }
.install-txt b { display: block; font: 700 15px var(--f-title); }
.install-txt span { font-size: 12.5px; color: #C9D2CD; }
.install .iconbtn { color: #C9D2CD; width: 34px; height: 34px; }
.install .iconbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.ios-share { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; }

/* ---------------------------------------------------------------- connexion */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(circle at 15% 10%, rgba(34,156,163,.16), transparent 40%),
  radial-gradient(circle at 90% 90%, rgba(228,21,92,.12), transparent 40%), var(--paper); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 26px; padding: 34px 30px 30px; box-shadow: var(--shadow); text-align: center; }
.login-card .field { text-align: left; }
.login-logo { display: block; margin: 0 auto 10px; }
.login-card h1 { font: 800 30px var(--f-title); margin: 0; letter-spacing: -.02em; }
.login-card h1 span { display: block; font: 500 12px var(--f-mono); color: var(--teal); letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.login-card p { margin: 10px 0 22px; }

/* ================================================================ mobile */
@media (max-width: 860px) {
  .contact { grid-template-columns: 40px 1fr auto; grid-template-areas: "av who icons" "av tel tel" "av mail mail"; row-gap: 4px; column-gap: 12px; }
  .contact .avatar { grid-area: av; align-self: start; }
  .contact .c-who { grid-area: who; }
  .contact .c-tel { grid-area: tel; }
  .contact .c-mail { grid-area: mail; }
  .contact .c-icons { grid-area: icons; }
  .contact .c-link.is-blank { display: none; }
  .tile-head { flex-wrap: wrap; }
  .tile-id { flex-basis: calc(100% - 50px); }
  .tile-meta { order: 3; flex-basis: 100%; max-width: none; align-items: flex-start; text-align: left; }
}

@media (max-width: 640px) {
  :root { --tabbar-h: 68px; }
  body { font-size: 15px; }
  .topbar { gap: 10px; padding-left: 16px; padding-right: 10px; }
  .mainnav { display: none; }
  .brand { margin-right: auto; }
  .wrap { padding: 14px 12px 40px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search { max-width: none; }
  .actions { margin: 0; }
  .actions .btn { flex: 1; padding: 0 10px; }
  .listbar { margin: 14px 4px 10px; }
  .sort select { height: 32px; font-size: 13px; }
  .tile { border-radius: 16px; }
  .tile-head { padding: 15px 10px 10px 18px; gap: 8px; }
  .tile-name { font-size: 19px; }
  .contacts { padding: 0 6px 6px 10px; }
  .contact { padding: 10px 4px; }
  .c-icons { gap: 0; }
  .ci { width: 38px; height: 38px; }
  .tile-foot { padding: 2px 14px 12px 18px; }
  .no-contact { padding-left: 18px; }

  .tabbar {
    display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); align-items: center; justify-content: space-around;
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 0; }
  .tabbar a .i { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on .i { color: var(--magenta); }
  .fab { width: 58px; height: 58px; margin-top: -26px; border-radius: 20px; border: 4px solid var(--paper); background: var(--magenta); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(228,21,92,.8); cursor: pointer; flex: none; }
  .fab .i { width: 26px; height: 26px; }
  .fab:active { transform: scale(.94); }

  /* modales en « feuille » plein écran */
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 10px); border-radius: 22px 22px 0 0; animation: sheet .26s cubic-bezier(.2,.9,.3,1); }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
  .modal-head { padding: 14px 10px 12px 18px; }
  .modal-body { padding: 16px 16px 8px; }
  .modal-foot { padding: 12px 16px calc(14px + var(--safe-b)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .btn-danger { flex: 0 0 auto; }
  .modal-foot .spacer { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .drops { grid-template-columns: 1fr; }
  .drop { min-height: 132px; }
  .rte-area { min-height: 52vh; }
  .field input { font-size: 16px; } /* évite le zoom auto sur iOS */
  .search input { font-size: 16px; }
}
