/* Layout idea: an interactive, self-editable project-manager CV. A profile lens re-weights the page; the career is a clickable Gantt with a detail panel; charts and lists are computed from one data block that the owner edits in place. */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #5d6673;
  --line: #dde0db;
  --accent: #1f4fd1;
  --c-formation: #1f4fd1;
  --c-pro: #2b8a6e;
  --c-entre: #d9502b;
  --c-music: #8a5cc7;
  --c-short: #8e98a3;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --label-w: 180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c; --surface: #1a2029; --ink: #e8ebef; --muted: #9aa4b1; --line: #2c3440;
    --accent: #7b9cff; --c-formation: #6f92ff; --c-pro: #4cc39d; --c-entre: #ff7a52; --c-music: #b58cf0; --c-short: #76808c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161c; --surface: #1a2029; --ink: #e8ebef; --muted: #9aa4b1; --line: #2c3440;
  --accent: #7b9cff; --c-formation: #6f92ff; --c-pro: #4cc39d; --c-entre: #ff7a52; --c-music: #b58cf0; --c-short: #76808c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
body.editing { padding-bottom: 110px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.06rem; font-weight: 700; }
.mono { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { font-size: 0.85rem; color: var(--muted); }

/* Editing affordances */
.editable { outline: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 3px; cursor: text; min-width: 1ch; }
.editable:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.editable:focus { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.editable:empty::before { content: attr(data-ph); color: var(--muted); }
.x-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 1rem; line-height: 1; border-radius: 4px; }
.x-btn:hover { color: var(--c-entre); background: color-mix(in srgb, var(--c-entre) 12%, transparent); }
.add-btn, .add-chip { border: 1px dashed var(--accent); color: var(--accent); background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 0.86rem; font-weight: 500; cursor: pointer; }
.add-btn:hover, .add-chip:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.add-btn { margin-top: 14px; }
.chip-wrap { display: inline-flex; align-items: center; gap: 2px; }

/* Header */
header { padding: 52px 0 28px; }
.hero { display: grid; grid-template-columns: 164px 1fr; gap: 36px; align-items: center; }
.photo { width: 164px; height: 164px; border-radius: 18px; object-fit: cover; display: block; border: 1px solid var(--line); }
.photo-edit { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 18px; }
.photo-edit span { position: absolute; inset: auto 8px 8px 8px; background: var(--ink); color: var(--bg); font-size: 0.8rem; padding: 4px 8px; border-radius: 8px; text-align: center; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.tag { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.pitch { max-width: 62ch; margin: 14px 0 18px; color: var(--muted); font-size: 1.05rem; }
.contact { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 0.95rem; }
.contact > * { display: inline-flex; align-items: center; gap: 8px; }
.contact a { text-decoration: none; font-weight: 500; }
.contact a:hover { text-decoration: underline; }
.contact svg { width: 16px; height: 16px; flex: none; }

/* Lens bar */
.lensbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin: 0 -24px 32px; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.lensbar > span { font-size: 0.88rem; color: var(--muted); }
.lenses { display: flex; flex-wrap: wrap; gap: 6px; }
.lens { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.lens:hover { border-color: var(--ink); }
.lens[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.edit-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.edit-toggle:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.edit-toggle svg { width: 15px; height: 15px; }
.lensable { transition: opacity .2s; }
body:not([data-lens="all"]) .lensable.off { opacity: 0.22; }

/* Key figures */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0 0 48px; }
.fig { background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.fig b { display: block; font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.fig span { font-size: 0.88rem; color: var(--muted); }

/* Sections */
section { margin-bottom: 52px; scroll-margin-top: 70px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }

/* Gantt + panel */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.gantt-scroll { overflow-x: auto; padding-top: 18px; }
.gantt { min-width: 640px; display: grid; grid-template-columns: var(--label-w) 1fr; row-gap: 6px; position: relative; }
.g-label { font-size: 0.85rem; font-weight: 500; padding-right: 12px; display: flex; align-items: center; min-height: 32px; line-height: 1.25; }
.g-label small { display: block; color: var(--muted); font-weight: 400; font-size: 0.74rem; }
.g-track { position: relative; min-height: 32px; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--yw) - 1px), color-mix(in srgb, var(--line) 70%, transparent) calc(var(--yw) - 1px), color-mix(in srgb, var(--line) 70%, transparent) var(--yw)); }
.g-bar, .g-ms { position: absolute; border: 0; padding: 0; cursor: pointer; background: var(--c); transition: transform .15s, box-shadow .15s, opacity .2s; }
.g-bar { top: 7px; height: 18px; border-radius: 4px; }
.g-bar.live { border-top-right-radius: 0; border-bottom-right-radius: 0; background: linear-gradient(to right, var(--c) 85%, color-mix(in srgb, var(--c) 35%, transparent)); }
.g-ms { top: 9px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); border-radius: 2px; }
.g-bar:hover { transform: scaleY(1.25); }
.g-ms:hover { transform: rotate(45deg) scale(1.25); }
.g-bar.sel, .g-ms.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.gantt.hl-mode .g-bar:not(.hl), .gantt.hl-mode .g-ms:not(.hl) { opacity: 0.15; }
.g-axis { position: relative; height: 22px; }
.g-axis span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.g-today { position: absolute; top: 0; bottom: 22px; width: 2px; background: var(--ink); opacity: 0.5; pointer-events: none; }
.g-today::after { content: "aujourd’hui"; position: absolute; top: -18px; right: 4px; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.legend button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px 10px; font-size: 0.82rem; cursor: pointer; }
.legend button[aria-pressed="false"] { opacity: 0.4; text-decoration: line-through; }
.legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--c); }
.legend i.dia { transform: rotate(45deg) scale(0.85); border-radius: 2px; }

.panel { border-left: 4px solid var(--c, var(--accent)); background: var(--bg); border-radius: 12px; padding: 18px 20px; min-height: 260px; }
.panel .kicker { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.panel h3 { font-size: 1.3rem; margin: 6px 0 2px; }
.panel .org { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }
.panel ul { margin: 0 0 14px; padding-left: 18px; }
.panel li { margin: 3px 0; }
.dur { display: inline-block; font-family: var(--mono); font-size: 0.78rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; margin-top: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 0.76rem; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.nav { display: flex; justify-content: space-between; margin-top: 16px; gap: 8px; }
.nav button, .btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: 0.86rem; cursor: pointer; }
.nav button:hover, .btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { color: var(--c-entre); border-color: color-mix(in srgb, var(--c-entre) 50%, var(--line)); }
.btn.danger.armed { background: var(--c-entre); color: #fff; }

/* Panel form */
.form { display: grid; gap: 10px; }
.form h3 { font-size: 1rem; margin: 0 0 4px; }
.field { display: grid; gap: 3px; font-size: 0.8rem; color: var(--muted); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 9px; font-size: 0.9rem; color: var(--ink); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.86rem; color: var(--ink); }
.checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.form-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

/* Charts */
.charts { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; }
.chart-title { font-size: 1rem; margin-bottom: 4px; }
.chart-sub { font-size: 0.84rem; color: var(--muted); margin: 0 0 18px; }
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; gap: 5px; border-radius: 8px; padding: 4px; margin: -4px; }
.hbar:hover, .hbar:focus-visible { background: var(--bg); }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.hbar-top b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.hbar-track { height: 14px; border-radius: 4px; background: var(--bg); position: relative; overflow: hidden; }
.hbar-fill { position: absolute; inset: 0 auto 0 0; display: flex; }
.hbar-fill span { height: 100%; background: var(--c); border-right: 2px solid var(--surface); }
.hbar-fill span:last-child { border-right: 0; }
.hbar-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
.matrix-scroll { overflow-x: auto; }
.matrix { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 0.86rem; }
.matrix th, .matrix td { padding: 0; text-align: center; }
.matrix thead th { font-weight: 500; font-size: 0.72rem; color: var(--muted); height: 96px; vertical-align: bottom; padding-bottom: 6px; }
.matrix thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.matrix tbody th { text-align: left; font-weight: 500; }
.matrix tbody th > button { width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.matrix tbody th .sk-edit { display: flex; align-items: center; gap: 4px; padding: 6px 4px; }
.matrix tbody tr:hover th > button { background: var(--bg); }
.matrix tbody tr.active th > button { background: var(--ink); color: var(--bg); }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--c); vertical-align: middle; transition: transform .15s; }
.dot.empty { background: transparent; border: 1px dashed var(--line); width: 8px; height: 8px; }
.dot.noted { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--c); }
.matrix tbody tr.active .dot:not(.empty) { transform: scale(1.3); }
.cell-btn { border: 0; background: transparent; cursor: pointer; width: 32px; height: 30px; border-radius: 6px; }
.cell-btn:hover { background: var(--bg); }
.matrix td.count { font-family: var(--mono); color: var(--muted); padding-left: 10px; text-align: left; white-space: nowrap; }
.matrix td.count i { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.matrix td.cell { width: 38px; }

/* Projects */
.projects { display: grid; gap: 20px; }
.featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px 28px; border-left: 5px solid var(--pc); }
.featured .kicker { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pc); margin-bottom: 6px; display: inline-block; }
.featured h3 { font-size: 1.6rem; margin-bottom: 2px; }
.featured p { margin: 10px 0 0; color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.checklist li::before { content: ""; width: 14px; height: 14px; margin-top: 5px; border-radius: 4px; background: color-mix(in srgb, var(--pc) 18%, transparent); border: 2px solid var(--pc); }
.gallery { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gal-item { position: relative; display: grid; gap: 6px; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 10px; }
.gal-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--line); transition: transform .2s; }
.gal-item:hover img { transform: scale(1.02); }
.gal-item.editing { cursor: default; }
.gal-item.editing:hover img { transform: none; }
.gal-cap { font-size: 0.82rem; color: var(--muted); }
.gal-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.gal-tools button { border: 0; background: var(--ink); color: var(--bg); border-radius: 6px; width: 28px; height: 26px; cursor: pointer; font-size: 0.9rem; }
.gal-add { display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 4 / 3; border: 2px dashed var(--accent); border-radius: 10px; color: var(--accent); cursor: pointer; text-align: center; padding: 10px; font-weight: 600; font-size: 0.9rem; }
.gal-add small { font-weight: 400; color: var(--muted); font-size: 0.76rem; }
.gal-add.drag { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Lists */
.entries { display: grid; gap: 12px; }
.entry { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-left: 4px solid var(--c); cursor: pointer; text-align: left; width: 100%; }
.entry:hover { border-color: var(--ink); border-left-color: var(--c); }
.entry .org { color: var(--muted); font-size: 0.92rem; margin: 2px 0 6px; }
.entry ul { margin: 0; padding-left: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mini { display: grid; gap: 12px; }
.mini-item { display: grid; grid-template-columns: 58px 1fr; gap: 14px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; width: 100%; }
.mini-item:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-item p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.mini-item strong { font-weight: 600; }
.mini-item:hover strong { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 0.88rem; }
.skill-group + .skill-group { margin-top: 20px; }
.skill-group h3 { font-size: 0.95rem; margin-bottom: 10px; display: inline-block; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Logos, icons, flags */
.logo { display: block; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; flex: none; }
.logo.sm { width: 24px; height: 24px; padding: 2px; border-radius: 6px; }
.logo.md { width: 44px; height: 44px; }
.logo.lg { width: 54px; height: 54px; }
.panel-logo { float: right; margin: 0 0 8px 12px; }
.logo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-label { gap: 8px; }
.entry .side { display: grid; gap: 10px; align-content: start; }
.mi-head { display: flex; gap: 8px; align-items: center; }
.chip.has-ic { display: inline-flex; align-items: center; gap: 7px; }
.chip-ic { width: 18px; height: 18px; object-fit: contain; display: block; }
.ic-btn { width: 28px; height: 28px; border: 1px dashed var(--accent); background: var(--surface); border-radius: 6px; cursor: pointer; display: grid; place-items: center; padding: 3px; color: var(--accent); }
.ic-btn img { width: 100%; height: 100%; object-fit: contain; }
.ic-btn svg { width: 15px; height: 15px; }
.langs { display: grid; gap: 12px; }
.lang-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 4px 10px; font-weight: 500; }
.flag { width: 28px; height: 19px; border-radius: 3px; overflow: hidden; display: block; box-shadow: 0 0 0 1px var(--line); }
.flag svg { width: 100%; height: 100%; display: block; }
.lvl { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); font-weight: 400; }
.meter { display: flex; gap: 3px; }
.meter i { width: 14px; height: 8px; border-radius: 2px; background: var(--line); }
.meter i.on { background: var(--accent); }
.lang-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lang-edit select, .proj-tools select { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 6px; font-size: 0.82rem; }

/* Project media */
.proj-head { display: flex; gap: 14px; align-items: flex-start; }
.proj-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-size: 0.84rem; color: var(--muted); }
.media { grid-column: 1 / -1; columns: 3 200px; column-gap: 12px; }
.media > * { break-inside: avoid; margin: 0 0 12px; width: 100%; }
.m-item { position: relative; display: block; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; text-decoration: none; }
.m-item img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); transition: filter .2s; }
.m-item:hover img { filter: brightness(1.06); }
.m-item .cap { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.m-frame, .m-tile { position: relative; }
.m-tile { aspect-ratio: 16 / 9; border-radius: 10px; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #000)); }
.m-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.m-play > span { width: 54px; height: 54px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; transition: transform .15s; }
.m-item:hover .m-play > span { transform: scale(1.1); }
.m-play svg { width: 22px; height: 22px; color: #fff; margin-left: 3px; }
.m-badge { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.7rem; padding: 2px 7px; border-radius: 6px; font-family: var(--mono); }
.m-edit { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--bg); display: grid; gap: 6px; position: relative; }
.m-edit img { width: 100%; height: auto; display: block; border-radius: 8px; }
.m-edit input[type="text"] { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 5px 8px; font-size: 0.82rem; }
.m-edit .gal-tools { top: 14px; right: 14px; }
.media-add { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.media-add .gal-add { aspect-ratio: auto; padding: 16px 20px; flex: 1 1 220px; }
.media-add .add-btn { margin: 0; flex: 1 1 220px; }

/* Tooltip, lightbox, edit bar */
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 11px; border-radius: 8px; font-size: 0.8rem; line-height: 1.4; max-width: 280px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(10, 12, 16, 0.86); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lb-inner { max-width: min(1100px, 100%); display: grid; gap: 12px; }
.lb-inner img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; display: block; margin: 0 auto; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e8ebef; flex-wrap: wrap; }
.lb-bar .mono { color: #9aa4b1; }
.lb-nav { display: flex; gap: 6px; }
.lb-nav button { border: 1px solid #3a4250; background: #1a2029; color: #e8ebef; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.editbar { position: fixed; z-index: 40; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(760px, calc(100% - 24px)); background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.editbar strong { margin-right: 10px; }
.eb-status { font-size: 0.86rem; opacity: 0.85; }
.editbar .mono { color: inherit; opacity: 0.6; margin-left: 10px; }
.eb-actions { display: flex; gap: 8px; }
.editbar .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.editbar .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 920px) {
  .explorer, .charts, .featured, .cols, .tool-grid { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .panel { min-height: 0; }
}
@media (max-width: 600px) {
  header { padding-top: 32px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .photo { width: 116px; height: 116px; }
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .wrap { padding: 0 16px; }
  .lensbar { margin: 0 -16px 28px; padding: 10px 16px; }
  :root { --label-w: 140px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Admin login */
.login { max-width: 400px; margin: 12vh auto; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 12px; }
.login h1 { font-size: 1.6rem; }
.login input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 10px; font-size: 0.95rem; color: var(--ink); }
.login-err { color: var(--c-entre); font-size: 0.88rem; min-height: 1.2em; margin: 0; }
.editbar a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.eb-actions { flex-wrap: wrap; }
