/* Ciao Le Gras — feuille de style (aucune dépendance externe) */
:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #17231f;
  --muted: #5d6b66;
  --line: #e2ddd1;
  --primary: #17695a;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0ec;
  --danger: #b3321b;
  --danger-soft: #fbe9e5;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --ok: #1d7a4a;
  --ok-soft: #e1f3e8;
  --info-soft: #e5eef8;
  --c-kcal: #17231f;
  --c-protein: #2b5fa8;
  --c-fat: #d9552b;
  --c-carb: #c98a12;
  --c-weight: #17695a;
  --c-trend: #7a5ea8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 35, 31, .06), 0 4px 14px rgba(23, 35, 31, .05);
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }
code { background: #eee9dc; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.neg, .up { color: var(--danger); }
.down { color: var(--ok); }
.inline { display: inline; margin: 0; }
.noprint {}

:focus-visible { outline: 3px solid #f3b13b; outline-offset: 2px; border-radius: 4px; }

/* Mise en page */
.container { max-width: 1040px; margin: 0 auto; padding: 24px 16px 56px; }
.narrow { max-width: 640px; margin: 0 auto; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row2, .row3, .row4, .row5 { display: grid; gap: 0 14px; }
.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .g2, .g3, .g4, .row2, .row3 { grid-template-columns: 1fr; }
  .row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin-bottom: .1em; }

/* Barre du haut */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { color: var(--primary); }
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a, .usernav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.mainnav a:hover, .usernav a:hover { background: var(--primary-soft); color: var(--ink); }
.mainnav a.active, .usernav a.active { background: var(--primary-soft); color: var(--primary); }
.usernav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.linklike { background: none; border: 0; padding: 6px 10px; color: var(--muted); cursor: pointer; font: inherit; border-radius: 8px; }
.linklike:hover { background: var(--primary-soft); color: var(--ink); }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px; }

/* Invités */
.guest-top { max-width: 1040px; margin: 0 auto; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.guest-top nav { display: flex; gap: 14px; align-items: center; }
.guest-top nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.guest-main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; }
.bignum { font: 700 5rem/1 var(--serif); color: var(--primary); margin: 0; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.kpi-card { display: flex; flex-direction: column; gap: 2px; }
.kpis, .targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 12px 0 4px; }
.kpi, .targets > div { display: flex; flex-direction: column; }
.kpi-v { font: 700 1.5rem/1.15 var(--serif); }
.kpi-l { font-size: .82rem; color: var(--muted); }
.targets { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .targets { grid-template-columns: repeat(2, 1fr); } }

/* Alertes */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); border-color: #bfe3cc; color: #14532d; }
.alert-error { background: var(--danger-soft); border-color: #f1c4bb; color: #7a2412; }
.alert-warn { background: var(--warn-soft); border-color: #f0d9a0; color: var(--warn); }
.alert-info { background: var(--info-soft); border-color: #c7d9ee; color: #1d3f6e; }
.note { background: var(--info-soft); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin: 10px 0 0; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.insight { border-left: 5px solid var(--primary); }
.insight-water, .insight-whoosh { border-left-color: var(--c-protein); }
.insight-up { border-left-color: var(--c-fat); }
.insight p:last-child { margin-bottom: 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #125447; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f2714; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.btn.block { display: flex; width: 100%; }
.iconbtn { background: none; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; font: inherit; }
.iconbtn:hover { background: var(--danger-soft); color: var(--danger); }
a.iconbtn:hover { background: var(--primary-soft); color: var(--primary); }

/* Formulaires */
.form .field, .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfc9ba; border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 90, .18); }
.inputwrap { position: relative; }
.inputwrap .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.inputwrap input[type=number] { padding-right: 38px; }
.hint { font-size: .83rem; color: var(--muted); margin: 4px 0 0; }
.err { font-size: .85rem; color: var(--danger); margin: 4px 0 0; font-weight: 600; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--danger); }
.field.check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.field.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
fieldset.nutri { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 0 0 14px; }
fieldset.nutri legend { padding: 0 6px; font-size: .9rem; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-bottom: 10px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input { flex: 1 1 140px; width: auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; }
.danger-zone { border-color: #f1c4bb; background: #fffaf9; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* Étapes d'inscription */
.steps { display: flex; gap: 12px; list-style: none; padding: 0; margin: 0 0 20px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: .85rem; flex: none; }
.steps li.current { border-color: var(--primary); color: var(--ink); }
.steps li.current span { background: var(--primary); color: #fff; }
.steps li.done span { background: var(--ok); color: #fff; }

/* Tableaux */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .act { text-align: right; white-space: nowrap; width: 1%; }
.tbl tfoot th, .tbl tfoot td { border-bottom: 0; font-weight: 700; background: #faf8f3; }
.tbl.kv th { width: 45%; font-weight: 500; color: var(--muted); }
.tbl.summary th { font-weight: 600; }
.tbl.summary td { font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl.summary tr.rest td, .tbl.summary tr.rest th { background: var(--primary-soft); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #ece7da; color: var(--muted); vertical-align: middle; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.status { font-weight: 700; font-size: .9rem; }
.s-ok { color: var(--ok); } .s-warn { color: var(--warn); } .s-bad { color: var(--danger); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* Macros */
.macros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; margin: 14px 0 6px; }
@media (max-width: 520px) { .macros { grid-template-columns: 1fr; } }
.macro-h { display: flex; justify-content: space-between; align-items: baseline; font-size: .92rem; }
.macro-h .rem { font-size: .85rem; color: var(--muted); }
.macro-f { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.bar { height: 10px; background: #ece7da; border-radius: 99px; overflow: hidden; }
.bar.thin { height: 8px; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.bar.alt i { background: var(--c-fat); }
.m-kcal .bar i { background: var(--c-kcal); }
.m-p .bar i { background: var(--c-protein); }
.m-f .bar i { background: var(--c-fat); }
.m-c .bar i { background: var(--c-carb); }
.deficit { margin: 12px 0 0; }
.goal { margin-top: 12px; }
.goal-h { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; margin: 10px 0 4px; flex-wrap: wrap; }
.scen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.scen-i { display: flex; flex-direction: column; background: #faf8f3; border-radius: 10px; padding: 10px 12px; }
.scen-n { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.split { display: flex; height: 36px; border-radius: 8px; overflow: hidden; font-size: .85rem; font-weight: 600; color: #fff; }
.split-a { background: var(--c-fat); display: grid; place-items: center; }
.split-b { background: var(--c-protein); display: grid; place-items: center; }

/* Journal */
.datenav { display: flex; gap: 6px; align-items: center; }
.datenav input { width: auto; padding: 6px 10px; }
.meal .card-head h2 { font-size: 1.05rem; }
.food-tbl td:first-child { min-width: 160px; }
.sport-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
#food-search { margin: 6px 0 0; }
.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li button { display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 4px; cursor: pointer; font: inherit; color: var(--ink); }
.results li button:hover, .results li button:focus-visible { background: var(--primary-soft); }
.results .macro-s { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.preview { background: var(--primary-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; min-height: 44px; }
.preview:empty { display: none; }
.lesson summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.lesson[open] summary { margin-bottom: 10px; }
.prose { max-width: 62ch; }
.prose ul { padding-left: 1.2em; }
.lesson-mini p { margin: 0; }

/* Graphiques */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin-bottom: 6px; }
.chart .legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; }
.chart .hl { stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart-empty { color: var(--muted); }

/* Back office */
body.adm { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.adm-side { background: #10211c; color: #d7e5df; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.adm-side .brand { color: #fff; }
.adm-side nav { display: flex; flex-direction: column; gap: 2px; }
.adm-side nav a { color: #b5c9c1; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.adm-side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-side nav a.active { background: var(--primary); color: #fff; }
.adm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.adm-side-foot a { color: #b5c9c1; }
.adm-side-foot .linklike { color: #b5c9c1; padding-left: 0; }
.adm-main { padding: 28px 28px 56px; min-width: 0; max-width: 1100px; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 18px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.vbar i { display: block; width: 100%; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 3px; }
.vbar-n { font-size: .8rem; font-weight: 700; }
.vbar-l { font-size: .72rem; color: var(--muted); }
@media (max-width: 860px) {
  body.adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .adm-side nav { flex-direction: row; flex-wrap: wrap; }
  .adm-side-foot { margin: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .adm-main { padding: 20px 14px 40px; }
}

@media print {
  body { background: #fff; }
  .topbar, .foot, .noprint, .adm-side { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .container { padding: 0; max-width: none; }
}

/* ---------- Page d'accueil ---------- */
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: #fdf3df; }
body.guest { background: radial-gradient(1100px 520px at 85% -80px, #d9f2e9 0%, transparent 60%), radial-gradient(900px 480px at -10% 120px, #fde8d6 0%, transparent 55%), var(--bg); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--primary); font-weight: 700; margin-bottom: .4em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 52ch; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.lp-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 32px; align-items: center; padding: 28px 0 40px; }
.lp-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.lp-hero h1 em { font-style: italic; color: var(--primary); background: linear-gradient(transparent 62%, #f9d98a 62%); padding: 0 .1em; }
.lp-trust { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; }
.lp-trust li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.lp-trust svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--ok-soft); stroke: var(--ok); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lp-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(23, 35, 31, .14)); }
.lp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--ink); color: #fff; border-radius: 18px; overflow: hidden; margin: 8px 0 56px; }
.lp-stats div { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid rgba(255, 255, 255, .12); }
.lp-stats div:last-child { border-right: 0; }
.lp-stats strong { font: 700 1.7rem/1.1 var(--serif); color: #f3b13b; }
.lp-stats div:nth-child(2) strong { color: #7fd6bd; }
.lp-stats div:nth-child(3) strong { color: #ff9b78; }
.lp-stats span { font-size: .9rem; color: #c9d6d1; }
.lp-section { margin-bottom: 56px; }
.lp-h2 { text-align: center; font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 1em; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); border-top: 5px solid var(--fc); transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(23, 35, 31, .1); }
.feature h3 { margin: 14px 0 6px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.ficon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--fb); }
.ficon svg { width: 26px; height: 26px; fill: none; stroke: var(--fc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.f-green { --fc: #17695a; --fb: #e3f0ec; } .f-orange { --fc: #d9552b; --fb: #fbe9e1; } .f-blue { --fc: #2b5fa8; --fb: #e5eef8; }
.f-amber { --fc: #c98a12; --fb: #fdf1d6; } .f-purple { --fc: #7a5ea8; --fb: #efe9f7; } .f-rose { --fc: #c23b64; --fb: #fbe6ed; }
.lp-steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.lp-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.lp-steps h3 { margin-bottom: 4px; } .lp-steps p { margin: 0; color: var(--muted); font-size: .93rem; }
.step-n { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 1.2rem var(--serif); color: #fff; }
.n1 { background: #17695a; } .n2 { background: #c98a12; } .n3 { background: #d9552b; }
.lp-band { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: space-between; background: linear-gradient(120deg, #17695a 0%, #1f8a74 55%, #2b9b82 100%); color: #fff; border-radius: 24px; padding: 30px 34px; margin-bottom: 24px; }
.lp-band > div { flex: 1 1 280px; }
.lp-band h2 { color: #fff; margin-bottom: .2em; } .lp-band p { margin: 0; color: #d6efe7; }
.band-art { width: 84px; height: 84px; flex: none; }
@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; } .lp-hero-visual { max-width: 460px; margin: 0 auto; }
  .lp-stats, .features, .lp-steps ol { grid-template-columns: 1fr; }
  .lp-stats div { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .lp-band { padding: 24px; }
}

/* Assistant de saisie */
.chat{margin-bottom:1.25rem}
.chat-log{max-height:340px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem;padding:.25rem 0 .75rem}
.msg{display:flex}.msg.me{justify-content:flex-end}
.bubble{max-width:85%;padding:.55rem .8rem;border-radius:14px;background:#eef2f7;line-height:1.4;font-size:.95rem}
.msg.me .bubble{background:var(--primary,#2563eb);color:#fff}
.chat-labels{margin:.4rem 0 0;padding-left:1.1rem;font-size:.85rem}
.chat-labels.undone{text-decoration:line-through;opacity:.6}
.chat-form{display:flex;gap:.5rem;margin-top:.5rem}
.chat-form input{flex:1;min-width:0}
.chat-err{color:#b91c1c}

.ocr{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:.8rem}
.ocr pre{white-space:pre-wrap;max-height:180px;overflow:auto;background:#f6f8fa;padding:.5rem;border-radius:8px}

.chat-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.25rem 0 .5rem}
.chip{border:1px solid var(--primary);background:var(--primary-soft);color:var(--primary);border-radius:999px;padding:.35rem .75rem;font:inherit;font-size:.9rem;cursor:pointer}
.chip:hover{background:var(--primary);color:var(--primary-ink)}
.chat-guide{border:1px solid #dbe3ea;border-radius:12px;padding:.75rem;margin:.25rem 0 .5rem;background:#fafcfd}
.g-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}
.g-body{display:flex;flex-wrap:wrap;gap:.6rem}
.g-field{display:flex;flex-direction:column;gap:.15rem;font-size:.85rem;min-width:7rem;flex:1}
.g-field input,.g-field select,.g-row input,.g-row select{width:100%;min-width:0}
.g-rows{width:100%;display:flex;flex-direction:column;gap:.4rem}
.g-row{display:flex;gap:.4rem;width:100%;align-items:end}
.g-row>input:first-child{max-width:5.5rem}.g-row>select{max-width:7rem}
.g-row4{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;width:100%}
.g-prev{margin:.5rem 0;word-break:break-word}
.bubble.card{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:100%}
.bubble.card pre{white-space:pre-wrap;max-height:140px;overflow:auto;margin:.3rem 0 0}
.chat-thumb{display:block;max-width:140px;border-radius:8px;margin-top:.4rem}
.g-row4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g-row4 .g-field,.bubble.card .g-field{min-width:0}
.bubble.card{box-sizing:border-box}
.chat-log{max-height:480px}

.chips{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.5rem}
a.chip{text-decoration:none;display:inline-block}
.msg.nudge .bubble{background:#fff7e6;border:1px solid #f3dca8}
.g-video{width:100%;max-height:220px;border-radius:10px;background:#000}
#chat-mic.rec{background:#fee2e2;border-color:#ef4444}
.chat-form{align-items:center}
