/* AUTO IA — apparence inspirée d'Airtable (clair, bleu #166ee1, lignes fines, pastilles colorées). */
:root {
  --blue: #166ee1; --blue-h: #0f5fc9; --blue-soft: #e7f0fe; --blue-line: #9cc0f5;
  --text: #1d1f25; --text-2: #41454d; --muted: #616670; --faint: #8b8f96;
  --line: #e1e3e6; --line-2: #d0d4da; --gline: #e5e7eb; --vline: #eceef1;
  --bg: #ffffff; --bg-soft: #f8f9fb; --bg-hover: #f2f4f7; --bg-sel: #e9ecf1; --bg-head: #f7f8fa;
  --danger: #c22348; --ok: #2e8540;
  --radius: 6px; --shadow: 0 1px 2px rgba(16,24,40,.05); --shadow-pop: 0 0 0 1px rgba(0,0,0,.06), 0 6px 24px rgba(16,24,40,.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --base: #1a64d6; --base-light: #e8f0fd;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
#app { height: 100%; }
@supports (height: 100dvh) { @media (max-width: 760px) { html, body, #app { height: 100dvh; } } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--blue); text-decoration: none; }
code { font-family: var(--mono); font-size: 12.5px; background: #f1f3f6; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 600; letter-spacing: -.01em; }
.ic { display: block; flex: none; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ── Boutons & champs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: #fff; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--bg-hover); }
a.btn { color: var(--text); }
.btn-primary, a.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-h); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a51d3d; }
.btn-ghost { border-color: transparent; color: var(--blue); background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--blue-soft); }
.btn-small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 40px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); color: var(--text-2); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.icon-btn.on { background: var(--bg-sel); color: var(--text); }
.icon-btn.tiny { width: 22px; height: 22px; }
.icon-btn.boxed { border: 1px solid var(--line); background: #fff; width: 32px; height: 32px; }
.icon-btn.starred { color: #d99a00; }
.icon-btn.starred svg { fill: #fcb400; stroke: #d99a00; }
.link-btn { color: var(--blue); font-size: 13.5px; margin-top: 14px; }
.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,110,225,.15); }
select.input { padding-right: 28px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23616670' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; cursor: pointer; }
.input-inline { width: auto; height: 28px; font-size: 13px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-suffix { position: absolute; right: 10px; font-size: 12.5px; color: var(--muted); pointer-events: none; }
.lbl { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.chk-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 400; cursor: pointer; }
.chk-line input { width: 16px; height: 16px; accent-color: var(--blue); }
.note { font-size: 12.5px; padding: 8px 10px; border-radius: var(--radius); background: var(--blue-soft); color: #0f3a8a; }
.note.warn { background: #fff4de; color: #6b4a00; }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.form-err { background: #fde8ee; color: var(--danger); padding: 8px 10px; border-radius: var(--radius); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
details.help summary { cursor: pointer; font-size: 12.5px; color: var(--blue); margin: 4px 0; }
.help-row { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; margin: 5px 0; }
.help-row code { cursor: pointer; }
.help-list { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }

/* Interrupteur */
.toggle { width: 30px; height: 18px; border-radius: 9px; background: #cfd3d8; position: relative; flex: none; transition: background .15s; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.toggle.on { background: var(--ok); }
.toggle.on span { left: 14px; }
.toggle.small { width: 24px; height: 14px; }
.toggle.small span { width: 10px; height: 10px; }
.toggle.small.on span { left: 12px; }

/* Cases, pastilles */
.chk { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #b9bec6; display: inline-grid; place-items: center; background: #fff; color: #fff; flex: none; }
.chk.on { background: #20c933; border-color: #20c933; }
.chk.big { width: 22px; height: 22px; border-radius: 5px; cursor: pointer; }
.pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12.5px; line-height: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; flex: none; }
.pill-x { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; margin-right: -4px; opacity: .7; }
.pill-x:hover { opacity: 1; background: rgba(0,0,0,.1); }
.link-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px; background: #e8ecf4; color: var(--text); font-size: 12.5px; white-space: nowrap; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.link-chip.big { height: 26px; font-size: 13.5px; padding: 0 8px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; letter-spacing: .02em; }
.avatar-btn { border-radius: 50%; display: inline-flex; }
.base-icon { display: inline-grid; place-items: center; color: #fff; font-weight: 400; flex: none; letter-spacing: -.02em; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #d0f0fd; color: #04506f; }
.chip { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; background: #fff; }
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }

/* ── Popovers, menus, modales ── */
.pop-layer { position: fixed; inset: 0; z-index: 100; }
.pop { position: fixed; background: #fff; border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; max-height: min(70vh, 560px); overflow: auto; animation: popIn .12s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pop-pad { padding: 6px; }
.pop-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pop-list { max-height: 360px; overflow: auto; }
.pop-row { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 5px; font-size: 13.5px; }
.pop-row.click { cursor: pointer; }
.pop-row.click:hover { background: var(--bg-hover); }
.pop-foot { display: flex; gap: 8px; padding: 8px 6px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.pop-foot .btn { flex: 1; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 10px; border-radius: 5px; font-size: 14px; text-align: left; color: var(--text); }
.menu-item:hover:not(:disabled), .menu-item.active { background: var(--bg-hover); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.acc-head { padding: 10px 10px 8px; }
.acc-head b { font-size: 15px; }
.acc-head .muted { font-size: 13.5px; }
.modal-layer { position: fixed; inset: 0; z-index: 90; background: rgba(29,31,37,.45); display: grid; place-items: center; padding: 12px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: calc(100vh - 24px); display: flex; flex-direction: column; animation: popIn .16s ease; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 4px 20px; }
.modal-title { flex: 1; font-size: 17px; font-weight: 600; }
.modal-body { padding: 12px 20px 20px; overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; background: #1d1f25; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; display: flex; align-items: center; gap: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: popIn .18s ease; max-width: calc(100vw - 32px); }
.toast-btn { color: #9cc7ff; font-weight: 600; }
.empty-note { padding: 18px; color: var(--muted); text-align: center; font-size: 13.5px; }
.loading-screen { height: 100%; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code { position: relative; background: #1d1f25; color: #e6e8ec; border-radius: 8px; margin: 8px 0 14px; }
.code pre { margin: 0; padding: 12px 44px 12px 14px; font: 12.5px/1.6 var(--mono); overflow-x: auto; white-space: pre; }
.code-copy { position: absolute; top: 6px; right: 6px; color: #c7cbd3; }
.code-copy:hover:not(:disabled) { background: rgba(255,255,255,.1); color: #fff; }

/* ── Connexion ── */
.login-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--bg-soft); }
.login-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px; box-shadow: 0 8px 30px rgba(16,24,40,.06); text-align: center; }
.login-card h1 { font-size: 24px; margin: 22px 0 4px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; text-align: left; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -.02em; white-space: nowrap; }
.logo.big { font-size: 22px; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--blue); color: #fff; display: inline-grid; place-items: center; flex: none; }
.logo.big .logo-mark { width: 34px; height: 34px; border-radius: 8px; }

/* ── Coquille : accueil ── */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fff; }
.top-search { position: absolute; left: 50%; transform: translateX(-50%); width: min(460px, 40vw); height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); background: #fff; }
.top-search input { flex: 1; border: 0; outline: 0; background: none; font-size: 14.5px; color: var(--text); min-width: 0; }
.top-search kbd { font: 12.5px var(--font); color: var(--muted); }
.top-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; font-size: 14.5px; }
.top-link:hover { background: var(--bg-hover); }
.app-body { flex: 1; display: flex; min-height: 0; position: relative; }
.home-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 16px; border-right: 1px solid var(--line); overflow: auto; background: #fff; }
.side-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 8px; font-size: 16px; font-weight: 500; color: var(--text); width: 100%; text-align: left; }
.side-item:hover { background: var(--bg-hover); }
.side-item.on { background: var(--bg-sel); }
.side-sub { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px 0 20px; border-radius: 6px; font-size: 14px; color: var(--text); }
.side-sub span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sub:hover { background: var(--bg-hover); }
.side-sub.on { background: var(--bg-sel); }
.side-hint { display: flex; gap: 12px; align-items: center; padding: 4px 14px 10px 16px; font-size: 13px; color: var(--muted); line-height: 1.3; }
.side-hint-ic { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: center; flex: none; color: var(--faint); }
.side-sec { margin: 16px 14px 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.side-foot { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 14px; margin: 16px 4px 12px; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: 6px; font-size: 15px; text-align: left; }
.side-link:hover { background: var(--bg-hover); }
.btn-create { height: 44px; font-size: 15px; border-radius: 8px; width: 100%; }
.home-main { flex: 1; min-width: 0; overflow: auto; background: #fff; }
.home { padding: 32px clamp(16px, 4vw, 48px) 48px; max-width: 1280px; }
.home-title { font-size: 28px; margin-bottom: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 34px; }
.quick-card { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; font-size: 14px; transition: box-shadow .15s, border-color .15s; }
.quick-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.1); border-color: var(--line-2); }
.quick-h { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 500; }
.home-sec-head { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.home-sec-title { font-size: 17px; color: var(--text-2); }
.base-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.base-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; box-shadow: var(--shadow); transition: box-shadow .15s; min-width: 0; }
.base-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.1); }
.base-card-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.base-card-name { font-size: 15.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.base-card-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.owner-tag { font-size: 12px; background: var(--bg-hover); padding: 1px 8px; border-radius: 999px; color: var(--text-2); }
.base-card-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; opacity: 0; transition: opacity .12s; }
.base-card:hover .base-card-actions, .base-row:hover .base-card-actions { opacity: 1; }
.base-card-actions .icon-btn.starred { opacity: 1; }
.base-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.base-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.base-row:last-child { border-bottom: 0; }
.base-row:hover { background: var(--bg-soft); }
.base-row .base-card-actions { position: static; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tpl-card { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.tpl-card:hover { background: var(--bg-soft); border-color: var(--line-2); }
.base-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); flex: none; }
.swatch.round { border-radius: 50%; width: 24px; height: 24px; }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.swatches { display: grid; grid-template-columns: repeat(10, 22px); gap: 6px; padding: 6px; }
.drawer-mask { display: none; }
.only-mobile { display: none; }

/* Admin */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.admin-tabs a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.admin-tabs a.on { color: var(--text); border-bottom-color: var(--blue); }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-bar p { margin: 0; max-width: 640px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.admin-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 14px; background: var(--bg-head); border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--vline); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.off td { opacity: .5; }
.admin-table .actions { text-align: right; white-space: nowrap; }
.admin-table .actions > * { margin-left: 6px; vertical-align: middle; }

/* Corbeille, import */
.trash-list, .map-list { display: flex; flex-direction: column; gap: 2px; }
.trash-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 6px; cursor: pointer; }
.trash-row:hover { background: var(--bg-hover); }
.trash-row input { width: 16px; height: 16px; accent-color: var(--blue); }
.map-row { display: grid; grid-template-columns: 1fr 16px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--vline); }
.map-col { display: flex; flex-direction: column; min-width: 0; }
.map-col span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Écran d'une base ── */
.base-screen { height: 100%; display: flex; flex-direction: column; background: #fff; }
.base-head { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 8px; border-bottom: 1px solid var(--line); position: relative; }
.rail-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; }
.rail-logo:hover { background: var(--bg-hover); }
.base-title { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; border-radius: 8px; min-width: 0; }
.base-title:hover { background: var(--bg-hover); }
.base-name { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; letter-spacing: -.01em; }
.base-tabs { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; height: 100%; }
.base-tabs button { height: 100%; padding: 0 12px; font-size: 14.5px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; }
.base-tabs button:hover { color: var(--text); }
.base-tabs button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.owner-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); background: var(--bg-hover); height: 26px; padding: 0 10px; border-radius: 999px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.btn-share { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 6px; background: var(--base); color: #fff; font-weight: 600; font-size: 14px; }
.btn-share:hover { filter: brightness(.93); }
.tbl-bar { height: 34px; flex: none; display: flex; align-items: stretch; background: var(--base-light); border-bottom: 1px solid var(--line); overflow-x: auto; padding-left: 8px; scrollbar-width: none; }
.tbl-tab { display: flex; align-items: center; gap: 2px; padding: 0 12px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; cursor: pointer; position: relative; flex: none; }
.tbl-tab:not(.on)::after { content: ""; position: absolute; right: 0; top: 9px; bottom: 9px; width: 1px; background: rgba(0,0,0,.12); }
.tbl-tab:hover:not(.on) { background: rgba(0,0,0,.04); }
.tbl-tab.on { background: #fff; color: var(--text); font-weight: 600; border-radius: 6px 6px 0 0; margin-top: 3px; box-shadow: 0 0 0 1px var(--line); clip-path: inset(-2px -2px 0 -2px); }
.tbl-menu { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: var(--text-2); }
.tbl-menu:hover { background: var(--bg-hover); }
.tbl-add { width: 38px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.tbl-add:hover { background: rgba(0,0,0,.05); }
.view-bar { height: 44px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.view-name { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; margin-left: 4px; }
.view-name:hover { background: var(--bg-hover); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 5px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; flex: none; }
.tb-btn:hover { background: var(--bg-hover); color: var(--text); }
.tb-btn.on { color: var(--text); }
.tb-search { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border: 1px solid var(--blue); border-radius: 6px; width: 240px; flex: none; }
.tb-search input { flex: 1; border: 0; outline: 0; min-width: 0; font-size: 13.5px; }
.base-body { flex: 1; min-height: 0; display: flex; }
.views-side { width: 260px; flex: none; border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; overflow: auto; background: #fff; }
.vs-create { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 6px; font-size: 14px; text-align: left; }
.vs-create:hover { background: var(--bg-hover); }
.vs-search { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; color: var(--muted); }
.vs-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 14px; }
.vs-list { display: flex; flex-direction: column; gap: 1px; }
.vs-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 10px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.vs-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-item:hover { background: var(--bg-hover); }
.vs-item.on { background: var(--bg-sel); font-weight: 500; }
.vs-more { opacity: 0; }
.vs-item:hover .vs-more { opacity: 1; }
.view-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: #fff; }

/* ── Grille ── */
.grid-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.grid { flex: 1; min-height: 0; overflow: auto; position: relative; outline: none; background: #fff; font-size: 13px; display: flex; flex-direction: column; align-items: flex-start; }
.grid > * { flex: none; }
.g-head { position: sticky; top: 0; z-index: 4; display: flex; background: var(--bg-head); border-bottom: 1px solid var(--line-2); }
.g-frozen { position: sticky; left: 0; z-index: 2; display: flex; flex: none; background: inherit; }
.g-head .g-frozen { z-index: 5; }
.g-hcell { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-right: 1px solid var(--gline); font-weight: 500; color: var(--text); flex: none; user-select: none; background: var(--bg-head); }
.g-hcell.prim { border-right: 1px solid var(--line-2); }
.g-hcell:hover { background: #eef0f3; }
.g-hcell.filt { background: #e7f7e3; } .g-hcell.sorted { background: #fff1e6; } .g-hcell.grouped { background: #f1eafe; }
.g-hicon { color: var(--muted); }
.g-hname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-hmenu { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); opacity: 0; flex: none; }
.g-hcell:hover .g-hmenu { opacity: 1; }
.g-hmenu:hover { background: rgba(0,0,0,.08); color: var(--text); }
.g-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 3; }
.g-resize:hover { background: var(--blue); opacity: .5; }
.g-hadd { display: grid; place-items: center; color: var(--muted); border-right: 1px solid var(--gline); flex: none; }
.g-hadd:hover { background: #eef0f3; color: var(--text); }
.g-num { display: flex; align-items: center; gap: 2px; padding: 0 4px 0 10px; color: var(--faint); font-size: 12px; flex: none; position: relative; background: inherit; }
.g-hnum { background: var(--bg-head); }
.g-color { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.g-idx { min-width: 22px; }
.g-idx.hide { display: none; }
.g-check { display: none; cursor: pointer; padding: 2px; }
.g-check.show { display: inline-flex; }
.g-check .chk.on { background: var(--blue); border-color: var(--blue); }
.g-row:hover .g-idx { display: none; }
.g-row:hover .g-check { display: inline-flex; }
.g-expand { margin-left: auto; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; color: var(--blue); opacity: 0; }
.g-row:hover .g-expand { opacity: 1; }
.g-expand:hover { background: var(--blue-soft); }
.g-body { position: relative; }
.g-row { position: absolute; left: 0; display: flex; background: #fff; border-bottom: 1px solid var(--gline); }
.g-row:hover { background: #f8f9fb; }
.g-row.sel { background: #eef4fe; }
.g-row.editing { z-index: 3; }
.g-cell { position: relative; display: flex; align-items: center; padding: 0 8px; border-right: 1px solid var(--vline); overflow: hidden; flex: none; height: 100%; cursor: default; }
.g-cell.prim { border-right: 1px solid var(--line-2); font-weight: 500; }
.g-cell.filt { background: rgba(32,201,51,.06); } .g-cell.sorted { background: rgba(255,111,44,.05); }
.g-cell.active { box-shadow: inset 0 0 0 2px var(--blue); border-radius: 2px; background: #fff; z-index: 1; }
.g-cell.editing { overflow: visible; z-index: 3; background: #fff; box-shadow: inset 0 0 0 2px var(--blue); }
.g-input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; padding: 0; }
.g-textarea { position: absolute; top: -1px; left: -1px; min-height: 140px; padding: 8px; border: 2px solid var(--blue); border-radius: 4px; outline: 0; font-size: 13px; line-height: 1.45; background: #fff; box-shadow: var(--shadow-pop); resize: vertical; z-index: 5; }
.cell-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.cell-text.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; align-self: flex-start; padding-top: 7px; }
.cell-text.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-text.linky { color: var(--blue); }
.cell-text.err { color: var(--danger); }
.cell-pills { display: flex; gap: 4px; overflow: hidden; width: 100%; align-items: center; }
.cell-pills.wrap { flex-wrap: wrap; align-self: flex-start; padding-top: 6px; }
.cell-center { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cell-atts { display: flex; gap: 4px; overflow: hidden; height: 100%; align-items: center; padding: 3px 0; }
.att-thumb { height: 100%; max-height: 100px; aspect-ratio: 1; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); flex: none; }
.att-file { height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 3px; background: #eef0f3; font-size: 10.5px; font-weight: 600; color: var(--text-2); flex: none; }
.rating { display: flex; gap: 1px; color: #d8dbe0; font-size: 15px; line-height: 1; cursor: pointer; }
.rating span.on { color: #fcb400; }
.rating.big { font-size: 24px; gap: 3px; }
.g-group { position: absolute; left: 0; background: #f3f4f7; border-bottom: 1px solid var(--line); }
.g-group.lvl1 { background: #f7f8fa; } .g-group.lvl2 { background: #fbfbfc; }
.g-group-in { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 10px; height: 100%; padding-right: 16px; cursor: pointer; font-size: 13px; }
.g-group-name { color: var(--muted); font-size: 12px; }
.g-group-val { font-weight: 600; }
.g-group-count { color: var(--muted); font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.g-addrow { position: absolute; left: 0; border-bottom: 1px solid var(--gline); background: #fff; }
.g-add-btn { position: sticky; left: 0; height: 100%; display: flex; align-items: center; padding-left: 14px; color: var(--muted); border-right: 1px solid var(--line-2); }
.g-add-btn:hover { background: #f8f9fb; color: var(--text); }
.g-empty { position: sticky; left: 0; padding: 18px; color: var(--muted); font-size: 13.5px; width: min(600px, 100%); }
.g-foot { position: sticky; bottom: 0; z-index: 4; display: flex; background: #fff; border-top: 1px solid var(--line-2); margin-top: auto; }
.g-body + .g-foot, .g-empty + .g-foot { margin-top: auto; }
.grid::after { content: ""; flex: none; height: 0; }
.g-foot .g-frozen { background: #fff; }
.g-fcount { display: flex; align-items: center; padding: 0 12px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line-2); }
.g-fcell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 8px; font-size: 12px; border-right: 1px solid var(--vline); cursor: pointer; flex: none; white-space: nowrap; overflow: hidden; }
.g-fcell:hover { background: var(--bg-hover); }
.g-fhint { display: none; align-items: center; gap: 2px; color: var(--muted); }
.g-fcell:hover .g-fhint { display: inline-flex; }
.bulk-bar { position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; background: #fff; box-shadow: var(--shadow-pop); padding: 8px 12px; border-radius: 10px; font-size: 13.5px; white-space: nowrap; }

/* Sélection d'options, liens, pièces jointes */
.sel-current { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
.sel-list { max-height: 280px; overflow: auto; }
.sel-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px; border-radius: 5px; text-align: left; }
.sel-item:hover { background: var(--bg-hover); }
.sel-item.create { color: var(--blue); font-size: 13.5px; }
.select-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; width: 100%; text-align: left; background: #fff; }
.select-box:hover { border-color: #aeb4bd; }
.placeholder { color: var(--faint); }
.link-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 52vh; overflow: auto; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.link-row:hover { border-color: var(--blue-line); }
.link-row.on { border-color: var(--blue); background: var(--blue-soft); }
.link-row .chk.on { background: var(--blue); border-color: var(--blue); }
.link-title { font-weight: 600; }
.link-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.link-meta b { font-weight: 500; color: var(--faint); }
.links-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.drop-all { border-radius: 12px; transition: background .12s, box-shadow .12s; }
.drop-all.over { background: var(--blue-soft); box-shadow: 0 0 0 3px var(--blue); }
.drop { border: 2px dashed var(--line-2); border-radius: 10px; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-align: center; }
.drop b { color: var(--text); }
.drop-all.over .drop { border-color: var(--blue); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.att-card { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.att-card img, .att-card video, .att-big { width: 100%; height: 115px; object-fit: cover; display: grid; place-items: center; background: var(--bg-soft); color: var(--muted); }
.att-card a { display: block; }
.att-ext { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 6px; background: #eef0f3; color: var(--text-2); font-size: 10.5px; flex: none; }
.att-ext.pdf { background: #ffdce5; color: #ba1e45; }
.att-ext.vid { background: #ede2fe; color: #6b1cb0; }
.att-mini-img { object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.att-field { border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; transition: background .12s, border-color .12s; }
.att-field.over { background: var(--blue-soft); border-color: var(--blue); border-style: solid; }
.att-line { display: flex; align-items: center; gap: 6px; }
.att-line-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.att-line-txt { display: flex; flex-direction: column; min-width: 0; }
.att-line-txt b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.g-cell.drop { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); z-index: 2; }
.g-att-add { margin-left: auto; width: 22px; height: 22px; display: none; place-items: center; border-radius: 4px; color: var(--muted); flex: none; background: #fff; border: 1px solid var(--line-2); }
.g-cell:hover .g-att-add, .g-cell.active .g-att-add { display: grid; }
.g-att-add:hover { color: var(--blue); border-color: var(--blue); }
.upload-panel { position: fixed; right: 16px; bottom: 76px; z-index: 210; width: min(340px, calc(100vw - 32px)); background: #fff; border-radius: 10px; box-shadow: var(--shadow-pop); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.upload-head { font-weight: 600; font-size: 13px; }
.upload-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.upload-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-pct { color: var(--muted); font-size: 12px; }
.upload-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 5px; overflow: hidden; }
.upload-bar span { display: block; height: 100%; background: var(--blue); transition: width .15s; }
.upload-item.ok .upload-bar span { background: #20c933; }
.upload-item.ok .ic { color: #20c933; }
.upload-item.err .ic, .upload-err { color: var(--danger); }
.upload-err { font-size: 12px; margin-top: 3px; }
.att-name { font-size: 12px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-del { position: absolute; top: 4px; right: 4px; background: #fff; box-shadow: var(--shadow); }
.ro-value { min-height: 34px; display: flex; align-items: center; padding: 0 10px; background: var(--bg-soft); border-radius: var(--radius); color: var(--text-2); }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice-row { display: flex; align-items: center; gap: 6px; }
.choice-row .swatch { width: 20px; height: 20px; border-radius: 50%; }
.type-list { max-height: 420px; overflow: auto; }

/* Filtres */
.flt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.flt-conj { width: 64px; flex: none; font-size: 13px; color: var(--muted); }
.flt-conj .input { height: 30px; }
.flt-field { width: 160px; flex: none; }
.flt-op { width: 150px; flex: none; }
.flt-row .input { height: 30px; font-size: 13px; }
.flt-multi, .pf-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.pf-choice { padding: 3px; border-radius: 999px; border: 2px solid transparent; opacity: .55; }
.pf-choice.on { opacity: 1; border-color: var(--blue); }

/* Fiche d'enregistrement */
.record-modal .modal-body { padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.rec-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 12px; border-bottom: 1px solid var(--line); }
.rec-nav { display: flex; flex-direction: column; }
.rec-nav .icon-btn { height: 18px; }
.rec-title { flex: 1; min-width: 0; }
.rec-name { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-body { display: flex; min-height: 0; flex: 1; height: min(76vh, 760px); }
.rec-fields { flex: 1; min-width: 0; overflow: auto; padding: 22px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.rec-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.rec-label .icon-btn { opacity: 0; }
.rec-field:hover .rec-label .icon-btn { opacity: 1; }
.rec-meta { padding-top: 12px; border-top: 1px solid var(--line); }
.activity { width: 340px; flex: none; border-left: 1px solid var(--line); background: var(--bg-soft); display: flex; flex-direction: column; min-height: 0; }
.activity-head { padding: 14px 16px 8px; font-weight: 600; }
.activity-list { flex: 1; overflow: auto; padding: 4px 16px; display: flex; flex-direction: column; gap: 14px; }
.act { display: flex; gap: 10px; font-size: 13px; }
.act-top { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.act-change { font-size: 12.5px; margin-top: 3px; word-break: break-word; }
.act-change s { color: var(--faint); }
.comment-text { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.comment-box { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; background: #fff; }

/* Kanban, calendrier, galerie */
.kanban, .gallery, .calendar { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-soft); }
.kanban-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; font-size: 13px; color: var(--muted); }
.kanban-cols { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px 14px 16px; overflow: auto; align-items: flex-start; }
.kcol { width: 280px; flex: none; background: #eef0f3; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 8px; max-height: 100%; }
.kcol.over { background: #e1e9f7; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; }
.kcount { color: var(--muted); font-size: 12.5px; }
.kcol-cards { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 20px; }
.kcard { background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px rgba(16,24,40,.04); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.kcard:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12), 0 0 0 1px rgba(16,24,40,.05); }
.kcard-cover { width: calc(100% + 24px); margin: -10px -12px 0; height: 140px; object-fit: cover; border-radius: 8px 8px 0 0; }
.kcard-title { font-weight: 600; font-size: 14px; }
.card-field { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; min-width: 0; }
.card-flabel { color: var(--muted); font-size: 11.5px; }
.card-fval { min-height: 18px; display: flex; align-items: center; overflow: hidden; }
.card-fval .cell-text.num { text-align: left; }
.kadd { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.kadd:hover { background: rgba(0,0,0,.05); color: var(--text); }
.gallery-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 14px; align-content: start; }
.gcard { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px rgba(16,24,40,.05); cursor: pointer; text-align: left; display: flex; flex-direction: column; }
.gcard:hover { box-shadow: 0 6px 16px rgba(16,24,40,.12), 0 0 0 1px rgba(16,24,40,.06); }
.gcard-cover { height: 160px; background: #eef0f3; display: grid; place-items: center; color: var(--faint); }
.gcard-cover img { width: 100%; height: 100%; object-fit: cover; }
.gcard-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.gadd { align-items: center; justify-content: center; gap: 8px; min-height: 220px; color: var(--muted); border: 2px dashed var(--line-2); box-shadow: none; background: transparent; }
.cal-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-title { font-size: 17px; font-weight: 600; text-transform: capitalize; margin-left: 6px; }
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 28px repeat(6, minmax(92px, 1fr)); overflow: auto; background: var(--line); gap: 1px; }
.cal-dow { background: #fff; font-size: 12px; color: var(--muted); display: grid; place-items: center; text-transform: capitalize; }
.cal-day { background: #fff; padding: 4px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; }
.cal-day.other { background: #fafbfc; }
.cal-day.other .cal-num { color: var(--faint); }
.cal-num { font-size: 12.5px; font-weight: 500; align-self: flex-end; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--blue); color: #fff; }
.cal-ev { font-size: 12px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; flex: none; }
.cal-more { font-size: 11.5px; color: var(--muted); }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--text-2); }
.empty-state h3 { margin: 6px 0 0; }

/* Formulaires */
.form-builder { flex: 1; min-height: 0; display: flex; }
.fb-side { width: 330px; flex: none; border-right: 1px solid var(--line); overflow: auto; background: #fff; }
.fb-section { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.fb-title { font-weight: 600; font-size: 13px; }
.fb-share { display: flex; align-items: center; gap: 12px; }
.fb-link { display: flex; gap: 6px; }
.fb-field { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-height: 28px; }
.fb-req { display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); }
.fb-preview { flex: 1; overflow: auto; background: var(--bg-soft); padding: 28px 16px; }
.pf-page { min-height: 100%; background: var(--bg-soft); padding: 32px 16px; display: flex; flex-direction: column; align-items: center; }
.pf-card { width: min(620px, 100%); margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.08), 0 0 0 1px rgba(16,24,40,.05); padding: 0 28px 28px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
.pf-band { height: 8px; margin: 0 -28px; background: var(--base); }
.pf-title { font-size: 26px; margin: 10px 0 0; }
.pf-desc { color: var(--text-2); margin: 0; white-space: pre-wrap; }
.pf-title-input { font-size: 24px; font-weight: 700; border: 0; outline: 0; padding: 12px 0 0; border-bottom: 1px dashed transparent; }
.pf-title-input:hover, .pf-desc-input:hover { border-bottom-color: var(--line-2); }
.pf-desc-input { border: 0; outline: 0; resize: vertical; color: var(--text-2); padding: 0; border-bottom: 1px dashed transparent; }
.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-label { font-weight: 600; font-size: 14px; }
.req { color: var(--danger); margin-left: 3px; }
.pf-field.err .input { border-color: var(--danger); }
.pf-err { color: var(--danger); font-size: 12.5px; }
.pf-submit { align-self: flex-start; height: 40px; padding: 0 22px; font-size: 15px; }
.pf-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 0 10px; text-align: center; color: var(--ok); }
.pf-done h2 { color: var(--text); font-size: 20px; }
.pf-foot { margin-top: 18px; font-size: 12px; color: var(--faint); }

/* Automatisations, API, partage */
.doc-page { flex: 1; overflow: auto; padding: 28px clamp(16px, 4vw, 48px) 48px; width: 100%; }
.doc-page > * { max-width: 980px; }
.doc-page h2 { font-size: 22px; }
.doc-page h3 { margin-top: 26px; font-size: 17px; }
.doc-page h4 { margin: 18px 0 4px; font-size: 14px; }
.hook-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 14px 0; display: flex; flex-direction: column; gap: 12px; background: #fff; }
.hook-top { display: flex; align-items: center; gap: 10px; }
.hook-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 12px; }
.hook-foot { display: flex; align-items: center; gap: 10px; }
.api-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: center; margin: 16px 0 8px; font-size: 13.5px; }
.api-kv span { color: var(--muted); }
.api-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.api-fields { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.api-fields th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; }
.api-fields td { border-bottom: 1px solid var(--vline); padding: 6px 8px; }
.api-fields td:first-child { display: flex; align-items: center; gap: 6px; }
.share-sec { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.share-sec:last-child { border-bottom: 0; }
.share-h { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.share-sec p { margin: 0; }
.share-row { display: flex; align-items: center; gap: 10px; }

html { -webkit-text-size-adjust: 100%; }
button, .tb-btn, .icon-btn, .menu-item, .pop-row, .tbl-tab, .base-tabs button, .g-cell, .g-hcell { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* ── Petits écrans ── */
@media (max-width: 900px) {
  .base-tabs { position: static; transform: none; }
  .base-name { max-width: 30vw; }
  .tb-label { display: none; }
  .owner-chip { display: none; }
  .activity { display: none; }
  .hook-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .only-mobile { display: inline-grid; }
  .hide-mobile { display: none; }
  .top-search { position: static; transform: none; width: auto; flex: 1; }
  .top-search kbd { display: none; }
  .topbar .logo-text { display: none; }
  .home-side { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 50; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-pop); width: min(300px, 86vw); }
  .home-side.open { transform: none; }
  .drawer-mask { display: block; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.3); z-index: 49; }
  .home { padding: 20px 16px 40px; }
  .base-grid, .quick-grid { grid-template-columns: 1fr; }
  .base-card-actions { opacity: 1; }
  .views-side { position: absolute; z-index: 30; top: 0; bottom: 0; box-shadow: var(--shadow-pop); }
  .base-body { position: relative; }
  .base-tabs { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .base-tabs button { padding: 0 6px; font-size: 13px; white-space: nowrap; }
  .base-head { gap: 6px; padding: 0 8px; }
  .base-head > .grow, .rail-logo { display: none; }
  .base-title { flex: none; padding: 0 2px; }
  .base-name { display: none; }
  .form-builder { flex-direction: column; overflow: auto; }
  .fb-side { width: 100%; border-right: 0; }
  .fb-preview { overflow: visible; }
  .rec-fields { padding: 16px; }
  .flt-row { flex-wrap: wrap; }
  .flt-field, .flt-op { width: calc(50% - 40px); }
  .tb-search { width: 160px; }
  .g-num { padding-left: 6px; }
  .g-idx { min-width: 14px; }
  .g-expand { opacity: 1; }
  .g-row:hover .g-idx { display: inline; }
  .g-row:hover .g-check:not(.show) { display: none; }
}

/* ── Téléphone : cibles tactiles, feuilles du bas, zones sûres ── */
@media (max-width: 760px) {
  body { overscroll-behavior-y: none; }
  .input, .tb-search input, .g-input, .g-textarea, select.input, textarea.input, .top-search input { font-size: 16px; }
  .input { height: 40px; }
  .btn { height: 38px; }
  .btn-small { height: 34px; }
  .icon-btn { width: 38px; height: 38px; }
  .icon-btn.tiny { width: 28px; height: 28px; }
  .icon-btn.boxed { width: 38px; height: 38px; }
  .tb-btn { height: 36px; padding: 0 10px; }
  .tbl-bar { height: 40px; }
  .tbl-tab { padding: 0 14px; }
  .view-bar { height: 50px; }
  .menu-item { height: 44px; }
  .pop-row { height: 40px; }
  .base-head { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .topbar { padding-top: env(safe-area-inset-top); }
  .modal-layer { align-items: end; padding: 0; }
  .modal { width: 100% !important; max-width: none !important; border-radius: 14px 14px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-body { padding: 12px 16px 20px; }
  .modal-head { padding: 14px 12px 4px 16px; }
  .modal-foot { padding: 12px 16px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .doc-page { padding: 18px 14px 40px; }
  .hook-top, .hook-foot { flex-wrap: wrap; }
  .api-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .api-fields { display: block; overflow-x: auto; }
}
