/* Mesh Helm app screens for the website drafts.
   The colours, sizes and class names are copied from app/index.html, so the screens look like the real app.
   All data in app.js is sample data. Everything is scoped under .mh. */
.mh {
  --bg: #ffffff; --side: #f3f5f9; --sunk: #eef1f6; --ink: #1b2230; --dim: #667085; --line: #e1e6ee;
  --accent: #3466db; --on-accent: #ffffff; --sel: #dce6fa; --ok: #1b8755; --warn: #a9680c; --fail: #c2352b;
  --p0: #667085; --p1: #3466db; --p2: #b4541a; --p3: #167a68; --p4: #7a3fb0;
  --lift: 0 1px 2px rgba(27, 34, 48, 0.06), 0 10px 30px -14px rgba(27, 34, 48, 0.3);
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color: var(--ink); font: 14px/1.5 var(--body); text-align: left; letter-spacing: 0;
}
.mh[data-theme='dark'] {
  --bg: #15181d; --side: #1b1f26; --sunk: #222832; --ink: #e6e9ee; --dim: #929baa; --line: #2b313b;
  --accent: #7fa5f7; --on-accent: #10141b; --sel: #25344f; --ok: #4cc38a; --warn: #e3a948; --fail: #f0736a;
  --p0: #929baa; --p1: #7fa5f7; --p2: #e9935b; --p3: #4fc7b0; --p4: #c392ee;
  --lift: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -12px rgba(0, 0, 0, 0.7); color-scheme: dark;
}
.mh *, .mh *::before, .mh *::after { box-sizing: border-box; }
.mh button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.mh :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mh .dim { color: var(--dim); }
.mh .grow { flex: 1; min-width: 0; }
.mh .num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.mh .cap { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.mh .h1 { font: 700 26px/1.15 var(--body); letter-spacing: -0.02em; margin: 0 0 10px; }
.mh .h2 { font: 600 15px/1.3 var(--body); margin: 22px 0 8px; }
.mh p { margin: 0 0 10px; }

/* The window */
.mh.win { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--lift);
  display: grid; grid-template-columns: 216px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.mh .bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: var(--side); border-bottom: 1px solid var(--line); }
.mh .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.mh .bar span { margin: 0 auto; font-size: 12.5px; color: var(--dim); font-weight: 600; transform: translateX(-27px); }
.mh .side { background: var(--side); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow: hidden; }
.mh .nav2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 4px; }
.mh .nav2 .wide { grid-column: 1 / -1; }
.mh .it { display: flex; gap: 8px; align-items: center; padding: 5px 9px; border-radius: 7px; width: 100%; min-width: 0; font-size: 13.5px; }
.mh .it:hover { background: var(--sunk); }
.mh .it.on { background: var(--sel); font-weight: 600; }
.mh .it .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh .it .w { font: 11px var(--mono); color: var(--dim); }
.mh .it.new { background: var(--bg); border: 1px solid var(--line); font-weight: 600; margin-bottom: 4px; }
.mh .kbd { font: 11px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--dim); }
.mh .sep { height: 1px; background: var(--line); margin: 6px 9px; }
.mh .centre { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.mh .pulse { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mh .pb { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; font-weight: 500; white-space: nowrap; font-size: 13.5px; }
.mh .pb:hover, .mh .pb[aria-pressed='true'] { background: var(--sunk); }
.mh .pb b { font: 600 12.5px var(--mono); }
.mh .pb.hot { color: var(--fail); font-weight: 600; }
.mh .page { padding: 18px 20px 24px; overflow: auto; min-height: 0; container-type: inline-size; }
.mh .status { grid-column: 1 / -1; display: flex; gap: 16px; padding: 4px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); background: var(--side); }
.mh .status b { color: var(--fail); }

/* Marks: shape and colour together, never colour alone */
.mh .mark { display: inline-block; width: 9px; height: 9px; flex: none; }
.mh .mark.run { border-radius: 50%; background: var(--ok); }
.mh .mark.done { border-radius: 50%; border: 2px solid var(--line); }
.mh .mark.ok { border-radius: 50%; background: var(--ok); }
.mh .mark.fail { background: var(--fail); transform: rotate(45deg); }
.mh .mark.wait { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mh .mark.sched { border: 1.5px dashed var(--dim); }
.mh .pd { display: inline-block; width: 7px; height: 7px; border-radius: 2px; flex: none; margin-right: 5px; }

/* Parts of the pages */
.mh .tri { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mh .tri section { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mh .need { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; background: var(--bg); }
.mh .need.fail { border-left-color: var(--fail); }
.mh .need .t { font-weight: 600; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.mh .need .t .dim { font-weight: 400; display: inline-flex; align-items: center; }
.mh .need .why { font-size: 13px; }
.mh .need .why.hint { font-weight: 600; }
.mh .facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 12.5px; }
.mh .facts .k { color: var(--dim); }
.mh .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mh .btn { padding: 4px 11px; border: 1px solid var(--line); border-radius: 7px; font-weight: 600; background: var(--bg); font-size: 13px; text-align: center; }
.mh .btn:hover { border-color: var(--ink); }
.mh .btn.pri { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mh .rowc { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; min-width: 0; width: 100%; }
.mh .rowc .t { display: flex; gap: 7px; align-items: center; font-weight: 600; min-width: 0; }
.mh .rowc .t span:last-child, .mh .rowc .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh .rowc .s { color: var(--dim); font-size: 12.5px; }
.mh .digest { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.mh .digest > div { display: flex; gap: 9px; align-items: center; padding: 7px 11px; border-top: 1px solid var(--line); }
.mh .digest > div:first-child { border-top: 0; }
.mh .digest .dim { display: inline-flex; align-items: center; font-size: 12.5px; white-space: nowrap; }
.mh .empty { color: var(--dim); padding: 12px; border: 1px dashed var(--line); border-radius: 9px; }
.mh .badge { font: 600 10.5px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; color: var(--dim); white-space: nowrap; }
.mh .badge.off { color: var(--warn); border-color: var(--warn); }
.mh .badge.bad { color: var(--fail); border-color: var(--fail); }
.mh .runs { display: inline-flex; gap: 2px; align-items: center; }
.mh .runs i { width: 7px; height: 16px; border-radius: 2px; background: var(--line); }
.mh .runs i.ok { background: var(--ok); }
.mh .runs i.warn { background: var(--warn); }
.mh .runs i.bad { background: var(--fail); }
.mh .job { border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.mh .jobTop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mh .jobName { flex: 1; font-weight: 600; min-width: 150px; }
.mh .opsline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.mh .big { font: 700 30px/1 var(--body); letter-spacing: -0.03em; }
.mh .chart { display: flex; align-items: flex-end; gap: 3px; height: 96px; margin: 10px 0 4px; border-bottom: 1px solid var(--line); }
.mh .chart i { flex: 1; max-width: 26px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: 0.85; }
.mh .chart i.hi { background: var(--warn); opacity: 1; }
.mh .brow { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); width: 100%; font-size: 13.5px; }
.mh .brow span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh .brow i { display: block; height: 8px; border-radius: 2px; min-width: 2px; }
.mh .meter { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; }
.mh .meter div { height: 100%; background: var(--accent); border-radius: 5px; }
.mh .meter.warn div { background: var(--warn); }
.mh .budget { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; font-size: 13.5px; }
.mh .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 26px; }
.mh .map { display: flex; flex-direction: column; gap: 14px; }
.mh .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mh .mapnode { border: 1px solid var(--line); border-radius: 7px; padding: 2px 9px; font-size: 13px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.mh .mapnode:hover { border-color: var(--accent); }
.mh .mapnode.fail { border-color: var(--fail); }
.mh .mapnode.off { color: var(--dim); border-style: dashed; }
.mh .mapnode.dep { background: color-mix(in srgb, var(--warn) 22%, transparent); border-color: var(--warn); }
.mh .mapnode.use { background: var(--sel); }
.mh .mapnode.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mh .mapinfo { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; min-height: 74px; }
.mh .mapinfo .h2 { margin: 0; }
.mh .mapinfo .chips { margin-top: 2px; }
.mh .secp { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.mh .risk { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 8px; font-size: 13px; align-items: center; }
.mh .risk .fix { grid-column: 2; color: var(--dim); }
.mh .risk.high > span:nth-child(2) { color: var(--fail); font-weight: 600; }
.mh .impact { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 6px; }
.mh .impact .row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 2px 10px; font-size: 13px; }
.mh .impact .lv { font-weight: 600; }
.mh .impact .lv.breaks { color: var(--fail); }
.mh .ccp { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.mh .cch, .mh .ccs { display: flex; gap: 10px; align-items: center; padding: 8px 12px; min-width: 0; }
.mh .cch { background: var(--side); }
.mh .ccs { border-top: 1px solid var(--line); padding-left: 30px; }
.mh .ccs .t { font-weight: 600; }
.mh .steps .sum { font-size: 12.5px; margin: 6px 0 8px; display: flex; flex-direction: column; gap: 2px; }
.mh .step { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 3px 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mh .step .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh .step .track { grid-column: 2 / -1; position: relative; height: 6px; background: var(--sunk); border-radius: 3px; }
.mh .step .track i { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 3px; background: var(--accent); }
.mh .step.tool .track i { background: var(--dim); }
.mh .step.bad .track i { background: var(--fail); }
.mh .step.top .n { font-weight: 600; }
.mh .composer { border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--lift); padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.mh .composer .ph { font-size: 16px; color: var(--dim); min-height: 46px; }
.mh .tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mh .tb { border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; font-size: 12.5px; color: var(--dim); }
.mh .send { background: var(--accent); color: var(--on-accent); border-radius: 8px; padding: 5px 14px; font-weight: 600; font-size: 13.5px; }
.mh .sample { font-size: 11.5px; color: var(--dim); }
.mh .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 14px; }
.mh .tile { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.mh .tile .big { font-size: 24px; margin: 4px 0 2px; }
.mh .tile .dim { font-size: 12.5px; }
.mh .copyBox { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
.mh .sw { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; flex: none; display: inline-block; }
.mh .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.mh .sw.on { background: var(--accent); }
.mh .sw.on::after { left: 16px; }
.mh .swrow { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mh .swrow small { display: block; color: var(--dim); font-size: 12.5px; }
.mh .numbox { display: inline-block; border: 1px solid var(--line); border-radius: 7px; padding: 3px 10px; font: 12.5px var(--mono); }
.mh table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.mh th, .mh td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.mh th { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.mh td.num { font: 12.5px var(--mono); }
.mh .scrollx { overflow-x: auto; }

@media (max-width: 760px) {
  .mh.win { grid-template-columns: minmax(0, 1fr); }
  .mh.win .side { display: none; }
  .mh .page { padding: 14px 14px 18px; }
  .mh .bar span { transform: none; }
}

/* One session: the chat with its tool steps, and the Changes panel */
.mh .chat { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px 18px; align-items: start; max-width: 1020px; margin: 0 auto; }
.mh .chead { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.mh .chead .h1 { font-size: 18px; margin: 0; }
.mh .csub { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.mh .csub > span { display: inline-flex; align-items: center; }
.mh .ctx { display: inline-block; width: 54px; height: 6px; border-radius: 99px; background: var(--sunk); margin: 0 6px; overflow: hidden; }
.mh .ctx i { display: block; width: 38%; height: 100%; background: var(--accent); }
.mh .thread { display: grid; gap: 14px; min-width: 0; }
.mh .msgs { display: grid; gap: 10px; }
.mh .msg { overflow-wrap: anywhere; min-width: 0; }
.mh .msg.user { justify-self: end; max-width: 86%; background: var(--sunk); border-radius: 12px; padding: 10px 14px; }
.mh .msg.thought { color: var(--dim); font-style: italic; border-left: 2px solid var(--line); padding-left: 10px; }
.mh .tool { border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; display: flex; gap: 8px; align-items: center; font-size: 13px; min-width: 0; }
.mh .tool .tag { font: 11px var(--mono); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; color: var(--dim); flex: none; }
.mh .tool .d { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px var(--mono); }
.mh .tool.running { background: linear-gradient(100deg, transparent 40%, var(--sunk) 50%, transparent 60%); background-size: 300% 100%; animation: mh-sweep 2s linear infinite; }
.mh .tool.running .num { visibility: hidden; }
@keyframes mh-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.mh .msgs > .wait { display: none; }
.mh .msgs > .in { animation: mh-in .32s ease backwards; }
@keyframes mh-in { from { opacity: 0; transform: translateY(6px); } }
.mh .cpanel { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12.5px; min-width: 0; }
.mh .ptabs { display: flex; gap: 2px; padding: 6px; background: var(--side); border-bottom: 1px solid var(--line); }
.mh .ptabs span { padding: 3px 9px; border-radius: 6px; color: var(--dim); }
.mh .ptabs .on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.mh .pfile { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; padding: 8px 12px; }
.mh .diff { margin: 0; padding: 4px 0 8px; font: 11.5px/1.65 var(--mono); overflow-x: auto; border-block: 1px solid var(--line); }
.mh .diff span { display: block; padding: 0 12px; white-space: pre; }
.mh .diff .add { background: color-mix(in srgb, var(--ok) 15%, transparent); }
.mh .diff .del { background: color-mix(in srgb, var(--fail) 12%, transparent); }
.mh .diff .hunk { color: var(--dim); }
@container (max-width: 880px) { .mh .chat { grid-template-columns: minmax(0, 1fr); } .mh .cpanel { display: none; } }
