/* Palette taken from the WebSemantic logo: navy core, blue, teal and orange nodes. */
:root{--navy:#1f3a5f;--blue:#3b7dd8;--teal:#2a9d8f;--orange:#e07b3f;--ink:#1c2836;--mid:#5f6b7a;--light:#b8c2cf;
  --line:#e3e8ef;--soft:#f5f7fb;--bg:#ffffff}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{overscroll-behavior-y:contain}
button,a,textarea{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 Inter,Helvetica,Arial,sans-serif}
button,textarea{font:inherit;color:inherit}
a{color:var(--navy)}
.head{max-width:1360px;margin:0 auto;padding:14px 20px 10px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px}
.head .mark{width:40px;height:40px;flex:none}
.head h1{margin:0;font-size:22px;font-weight:600;letter-spacing:-.01em;color:var(--navy)}
.head h1 span{font-weight:400;color:var(--mid);font-size:16px;margin-left:8px}
.head p{margin:2px 0 0;color:#3b4654}
.head .affiliation{margin-left:auto;flex:none;line-height:0}
.head .affiliation img{height:44px;width:auto}
.switches{max-width:1360px;margin:0 auto;padding:12px 20px;display:flex;gap:14px;flex-wrap:wrap}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}
.seg button{border:0;background:#fff;padding:6px 13px;cursor:pointer;color:var(--mid)}
.seg button+button{border-left:1px solid var(--line)}
.seg button.on{background:var(--navy);color:#fff}
.grid{max-width:1360px;margin:0 auto;padding:4px 20px 10px;display:grid;grid-template-columns:5fr 6fr;gap:24px}
.chat{height:440px;overflow-y:auto;border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--soft)}
.msg{margin:0 0 10px;max-width:92%;padding:8px 12px;border-radius:10px;white-space:pre-wrap;word-wrap:break-word}
.msg.user{margin-left:auto;background:var(--navy);color:#fff;border-bottom-right-radius:3px}
.msg.bot{background:#fff;border:1px solid var(--line);border-bottom-left-radius:3px}
.msg.wait{color:var(--mid);font-style:italic}
.composer{display:flex;gap:6px;margin-top:8px}
.composer textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:8px;padding:9px 11px;min-height:44px;background:#fff}
.composer textarea:focus{outline:2px solid rgba(59,125,216,.35);border-color:var(--blue)}
button{cursor:pointer}
.primary,.icon{border:1px solid var(--navy);background:var(--navy);color:#fff;border-radius:8px;padding:0 15px;font-size:16px}
.primary:hover{background:#18304f}
.icon{background:#fff;color:var(--navy);border-color:var(--line);display:inline-flex;align-items:center;justify-content:center}
.icon svg{display:block}
.icon.rec{background:var(--orange);color:#fff;border-color:var(--orange)}
.examples{margin-top:12px;color:var(--mid);font-size:12.5px}
.examples .row{display:flex;justify-content:space-between;align-items:center}
.examples .more{border:0;background:none;color:var(--blue);font-size:12.5px;padding:0}
#examples{display:flex;flex-direction:column;gap:6px;margin-top:5px}
#examples button{text-align:left;border:1px solid var(--line);background:#fff;border-radius:8px;padding:7px 11px;color:var(--ink);
  border-left:3px solid var(--teal)}
#examples button.refuse{border-left-color:var(--orange)}
#examples button.ask{border-left-color:var(--blue)}
#examples .tag{display:inline-block;margin-left:8px;font-size:11px;padding:0 6px;border-radius:9px;background:#fdf0e7;color:#9a4a18;vertical-align:1px}
#examples button.ask .tag{background:#eaf2fc;color:#24569b}
#examples button:hover,.actions button:hover{border-color:var(--light)}
.actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.actions button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 12px;font-size:13px}
.actions button:disabled{opacity:.45;cursor:default}
.status{color:var(--mid);font-size:12.5px;min-height:18px;margin:8px 0 0}
.decision{border-left:3px solid var(--blue);background:#eff5fd;border-radius:0 8px 8px 0;padding:6px 12px;margin-bottom:10px}
.decision.execute{border-left-color:var(--teal);background:#edf7f5}
.decision.refuse{border-left-color:var(--orange);background:#fdf3ec}
.decision .code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;text-transform:uppercase;letter-spacing:.05em;
  color:var(--blue);margin-right:8px;font-weight:600}
.decision.execute .code{color:var(--teal)}
.decision.refuse .code{color:var(--orange)}
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:12px}
.tabs button{border:0;background:none;padding:7px 12px;color:var(--mid);border-bottom:2px solid transparent}
.tabs button.on{color:var(--navy);border-bottom-color:var(--navy);font-weight:500}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.kpis:empty{display:none}
.kpi{padding:10px 12px;background:var(--soft);border:1px solid var(--line);border-radius:10px}
.kpi b{display:block;font-size:21px;font-weight:600;color:var(--navy)}
.kpi small{color:var(--mid);font-size:11.5px}
.fig{margin:14px 0 0}
.fig figcaption{font-size:13px;font-weight:500;margin-bottom:4px;color:var(--navy)}
.fig svg{width:100%;height:auto;display:block}
.fig .legend{font-size:11.5px;color:var(--mid);margin-top:2px}
.fig .legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin:0 4px 0 10px;vertical-align:-1px}
.analysis{margin:14px 0 6px}
.provenance{font-size:12.5px;color:#3b4654;border-top:1px solid var(--line);padding-top:8px}
.provenance p{margin:3px 0}
.files{margin-top:8px;font-size:12.5px}
.files a{color:var(--navy);margin-right:12px}
table{border-collapse:collapse;width:100%;font-size:12.5px}
th,td{border-bottom:1px solid var(--line);text-align:left;padding:5px 6px;vertical-align:top}
th{color:var(--mid);font-weight:500}
td:nth-child(4){color:var(--mid)}
.about p{margin:0 0 10px}
.table-wrap{overflow-x:auto;margin-top:4px}
table.cases{font-size:12.5px}
table.cases th:first-child,table.cases tr th{white-space:nowrap}
table.cases tr:first-child th{background:var(--soft);color:var(--navy);font-weight:500}
table.cases tr:last-child th,table.cases tr:last-child td{font-weight:500}
caption{caption-side:top;text-align:left;font-size:12.5px;color:var(--mid);padding:2px 0 8px}
.app-link{display:inline-block;margin-left:4px;padding:3px 10px;border:1px solid var(--navy);border-radius:8px;color:var(--navy);
  text-decoration:none;font-size:12.5px;background:#fff}
.app-link:hover{background:var(--navy);color:#fff}
.files .open{margin:10px 0 0}
details summary{cursor:pointer;color:var(--navy);font-weight:500;margin-bottom:4px}
.jump{display:none}
.foot{max-width:1360px;margin:0 auto;padding:10px 20px 18px;text-align:center;color:#8c96a3;font-size:12px}
.foot a{color:#8c96a3}
@media (max-width:900px){
  /* minmax(0,1fr): a wide table scrolls inside its frame instead of widening the whole page */
  .grid{grid-template-columns:minmax(0,1fr);gap:16px;padding:4px 12px 10px}
  .grid > section{min-width:0}
  .head,.switches{padding-left:12px;padding-right:12px}
  .head .mark{width:34px;height:34px}
  /* phone: logo and title on one line, the Mines Paris - PSL / O.I.E. block mark on its own line below */
  .head{flex-wrap:wrap;align-items:flex-start;row-gap:8px}
  .head > div{flex:1 1 0;min-width:0}
  .head .affiliation{order:3;flex-basis:100%;margin:0}
  .head .affiliation img{height:30px}
  .head h1{font-size:20px}
  .head h1 span{display:block;margin:0;font-size:14px}
  /* one scroll only on a phone: the conversation grows with the page instead of capturing the finger */
  .chat{height:auto;min-height:120px;overflow:visible}
  .kpis{grid-template-columns:1fr 1fr}
  /* phone: the input stays at the bottom of the screen, always reachable; larger touch targets */
  /* the page ends above the fixed input, whatever its height (--dock is measured by app.js) */
  body{padding-bottom:calc(var(--dock,150px) + 12px)}
  html{scroll-padding-bottom:calc(var(--dock,150px) + 8px);scroll-padding-top:8px}
  body.talking .examples{display:none}
  /* phone: one fixed block at the bottom: the bar of sections, then the input that grows with the text */
  .composer{flex-wrap:wrap;align-items:flex-end}
  .jump{display:flex;flex-basis:calc(100% + 24px);order:-1;margin:-8px -12px 6px;border-bottom:1px solid var(--line)}
  .jump button{flex:1;border:0;background:none;padding:10px 4px;font-size:13px;color:var(--navy)}
  .jump button.on{font-weight:600;box-shadow:inset 0 2px 0 var(--navy)}
  .composer textarea{max-height:40vh;overflow-y:auto;scrollbar-width:thin}
  .composer{position:fixed;left:0;right:0;bottom:var(--kb,0px);z-index:1000;box-shadow:0 -2px 10px rgba(28,40,54,.08);margin:0;padding:8px 12px calc(8px + env(safe-area-inset-bottom));
    background:var(--bg);border-top:1px solid var(--line)}
  .composer textarea{font-size:16px;min-height:78px}
  .primary,.icon{min-width:48px;min-height:48px}
  .seg button,.tabs button{padding:10px 14px}
  #examples button,.actions button{padding:11px 12px}
  .msg.user{cursor:pointer}
  .pane{overflow-x:auto}
}
