/* Layer10's file. `layer10 client upgrade` merges any change made here, and it may conflict: */
/* ask for what you need on Layer10AI/layer10-platform instead (label platform-request). */
/* The Layer10 kit's styles: design tokens (light and dark) and the kit's
   components. A page links it first and overrides tokens in its own :root:

     <link rel="stylesheet" href="/kit/l10.css">
     <style> :root { --brand: #0b6e4f; } </style>

   Brand tokens, for a client to set: --brand (buttons, links, highlights),
   --brand-ink (text on --brand), --font, --radius. The rest follow the
   generated pages. */

/* Keep the scrollbar's space reserved, so pages of different lengths don't shift sideways. */
html { scrollbar-gutter: stable; }
:root {
  color-scheme: light dark;  /* native controls and scrollbars follow the scheme */
  --brand: #2f5fd0; --brand-ink: #ffffff;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --bg: #f7f7f5; --panel: #ffffff; --ink: #1d1d1b; --quiet: #6b6b66; --line: #e2e1dc;
  --accent: var(--brand); --accent-ink: var(--brand-ink); --mine: #e8eefc; --step: #f2f1ec;
  --bad: #b42318; --good: #1e6b2f; --good-bg: #e3f4e5; --warn: #8a5a00; --warn-bg: #fbf0d9;
  --shadow: 0 8px 30px rgba(0, 0, 0, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7c9cf0; --brand-ink: #10131c;
    --bg: #161615; --panel: #1f1f1d; --ink: #ecebe6; --quiet: #a3a29c; --line: #34332f;
    --mine: #24304d; --step: #2a2926;
    --bad: #f97066; --good: #8fd6a0; --good-bg: #1d3a24; --warn: #f0c56a; --warn-bg: #3d3016;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
button { font: inherit; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
         background: var(--accent); color: var(--accent-ink); }
button.plain { background: transparent; color: var(--quiet); padding: 4px 8px; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
input, textarea { font: inherit; color: var(--ink); background: var(--panel); width: 100%;
                  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
a { color: var(--accent); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.quiet { color: var(--quiet); }
.error { color: var(--bad); }

/* Markdown, as md() renders it. */
.md { white-space: normal; }
.md p { margin: 0 0 6px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 6px; padding-left: 20px; }
.md .md-h { font-weight: 600; margin: 6px 0 2px; }
.md code { font: 12.5px var(--mono); background: var(--step); padding: 1px 4px; border-radius: 4px; }
.md-table { overflow-x: auto; margin: 6px 0; }
.md-table table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.md-table th, .md-table td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md-table th { color: var(--quiet); font-weight: 600; }

/* ------------------------------------------------------------- <l10-shell> */
l10-shell { display: block; min-height: 100vh; }
.l10-header { display: flex; align-items: center; gap: 14px; padding: 12px 20px; flex-wrap: wrap;
              border-bottom: 1px solid var(--line); background: var(--panel); }
.l10-header .l10-client { color: var(--quiet); text-decoration: none; font-size: 14px; }
.l10-header h1 { font-size: 17px; margin: 0; }
.l10-header .l10-grow { flex: 1; }
.l10-header .l10-who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.l10-header a.l10-link { color: var(--quiet); text-decoration: none; font-size: 14px; }
.l10-header a.l10-link:hover { color: var(--ink); }
/* Agents and Jobs: the places, plainer than the quiet links beside them. */
a.l10-nav { color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
a.l10-nav:hover { color: var(--accent); }
.l10-badge { display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 6px; border-radius: 999px;
             background: #d29a12; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.l10-badge[hidden] { display: none; }
.l10-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px;
            max-width: 1180px; margin: 0 auto; padding: 20px; }
.l10-body.l10-solo { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.l10-main, .l10-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.l10-signin { text-align: center; padding: 48px 16px; }
@media (max-width: 900px) {
  .l10-body { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .l10-header { padding: 10px 16px; gap: 10px; }
  .l10-header .l10-who > span { display: none; }
}

/* Section headings the components share. */
.l10-title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet);
             margin: 0 0 8px; font-weight: 600; }

/* -------------------------------------------------------------- <l10-asks> */
l10-asks { display: block; }
l10-asks[hidden] { display: none; }
.l10-ask { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); padding: 14px; }
.l10-ask + .l10-ask { margin-top: 10px; }
.l10-ask .l10-ask-kind { font-size: 12px; font-weight: 600; color: var(--warn); text-transform: uppercase; letter-spacing: .05em; }
.l10-ask .l10-ask-q { margin: 4px 0 10px; color: var(--ink); }
.l10-ask .l10-ask-do { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.l10-ask .l10-ask-do input { flex: 1; min-width: 160px; }
.l10-ask button.decline { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.l10-ask .l10-ask-note { font-size: 13px; color: var(--quiet); }
.l10-empty { color: var(--quiet); font-size: 14px; }

/* ---------------------------------------------------------- <l10-activity> */
l10-activity { display: block; }
.l10-feed { list-style: none; margin: 0; padding: 0; }
/* The feed's own items (> li): a summary's markdown has lists of its own. */
.l10-feed > li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; padding: 7px 0;
               border-bottom: 1px solid var(--line); font-size: 14px; }
.l10-feed > li:last-child { border-bottom: 0; }
.l10-feed .l10-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 7px; }
.l10-feed > li.tool .l10-dot { background: var(--accent); }
.l10-feed > li.view .l10-dot { background: var(--good); }
.l10-feed > li.ask .l10-dot { background: var(--warn); }
.l10-feed > li.bad .l10-dot { background: var(--bad); }
.l10-feed > li.bad { color: var(--bad); }
.l10-feed > li.thought { color: var(--quiet); }
.l10-feed .l10-when { color: var(--quiet); font-size: 12px; }
.l10-working { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); margin-bottom: 6px; }
.l10-working::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
                       animation: l10-pulse 1.2s ease-in-out infinite; }
@keyframes l10-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .l10-working::before { animation: none; } }

/* -------------------------------------------------------------- <l10-chat> */
l10-chat { display: block; }
.l10-chat-launch { position: fixed; right: 20px; bottom: 20px; z-index: 40; border-radius: 999px;
                   padding: 12px 18px; box-shadow: var(--shadow); }
.l10-chat-panel { display: flex; flex-direction: column; background: var(--panel); min-height: 0; }
l10-chat[mode="drawer"] .l10-chat-panel, l10-chat:not([mode]) .l10-chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 50;
  border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .2s ease; visibility: hidden; }
l10-chat.open .l10-chat-panel { transform: none; visibility: visible; }
l10-chat[mode="panel"] .l10-chat-panel { border: 1px solid var(--line); border-radius: var(--radius); height: 560px; }
l10-chat[mode="panel"] .l10-chat-launch, l10-chat[mode="panel"] .l10-chat-close { display: none; }
@media (prefers-reduced-motion: reduce) { .l10-chat-panel { transition: none; } }
.l10-chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.l10-chat-head strong { flex: 1; }
.l10-chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.l10-msg { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
           overflow-wrap: anywhere; font-size: 14.5px; }
.l10-msg.user { background: var(--mine); align-self: flex-end; max-width: 88%; white-space: pre-wrap; }
.l10-msg.error { color: var(--bad); }
.l10-step { font: 12.5px/1.4 var(--mono); background: var(--step); border-radius: 8px; padding: 5px 10px;
            color: var(--quiet); overflow-wrap: anywhere; }
.l10-step.pending::after { content: " …"; }
.l10-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.l10-starters button { border: 1px solid var(--line); border-radius: 16px; font-size: 13.5px; text-align: left; }
.l10-chat-foot { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.l10-context { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--quiet); }
.l10-context span { background: var(--step); border-radius: 999px; padding: 2px 10px; }
.l10-context button { padding: 0 6px; }
.l10-chat-foot form { display: flex; gap: 8px; }

/* -------------------------------------------------------------- <l10-demo> */
/* "About this example": a calm callout, set apart from the agent's own work
   by a tint and a dashed edge. */
l10-demo { display: block; }
.l10-demo { border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius);
            background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.l10-demo > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px;
                      cursor: pointer; list-style: none; }
.l10-demo > summary::-webkit-details-marker { display: none; }
.l10-demo > summary::before { content: "\25B8"; color: var(--accent); width: 10px; transition: transform .15s ease; }
.l10-demo[open] > summary::before { transform: rotate(90deg); }
.l10-demo > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.l10-demo-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.l10-demo-name { font-size: 13px; color: var(--quiet); }
.l10-demo-body { padding: 0 14px 12px 34px; font-size: 14px; }
.l10-demo-about { margin: 0 0 10px; }
.l10-demo-part + .l10-demo-part { margin-top: 8px; }
.l10-demo h3 { font-size: 13px; font-weight: 600; margin: 0 0 4px; }
.l10-demo ol, .l10-demo ul { margin: 0; padding-left: 20px; }
.l10-demo li { margin: 2px 0; }
.l10-demo button.l10-demo-ask { background: var(--panel); color: var(--accent); border: 1px solid var(--line);
                                border-radius: 14px; padding: 1px 10px; font-size: 13.5px; margin: 1px 2px; text-align: left; }
.l10-demo button.l10-demo-ask:hover { border-color: var(--accent); }
@media (max-width: 600px) { .l10-demo-body { padding-left: 14px; } }
@media (prefers-reduced-motion: reduce) { .l10-demo > summary::before { transition: none; } }

/* ------------------------------------------------------------- <l10-graph> */
/* The canvas fills its frame; the caption, tools, a node's panel and notes
   float over it. Height: height="..." on the element, or --l10-graph-height. */
l10-graph { display: block; }
.l10-graph-frame { position: relative; background: var(--panel); border: 1px solid var(--line);
                   border-radius: var(--radius); overflow: hidden; }
.l10-graph-canvas { height: var(--l10-graph-height, 560px); width: 100%; }
.l10-graph-caption { position: absolute; left: 12px; top: 12px; max-width: min(60%, 520px); z-index: 2;
                     background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--accent);
                     border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.l10-graph-tools { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; z-index: 2; }
.l10-graph-tools button { background: var(--panel); padding: 4px 10px; font-size: 13px; }
.l10-graph-note { position: absolute; left: 12px; bottom: 12px; right: 12px; z-index: 2; font-size: 13px;
                  color: var(--quiet); pointer-events: none; }
.l10-graph-note.error { color: var(--bad); }
.l10-graph-panel { position: absolute; right: 12px; top: 52px; width: min(320px, calc(100% - 24px)); z-index: 3;
                   max-height: calc(100% - 64px); overflow-y: auto; background: var(--panel);
                   border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
                   padding: 12px 14px; font-size: 13.5px; }
.l10-graph-panel-head { display: flex; align-items: center; gap: 8px; }
.l10-graph-panel-head strong { flex: 1; font-size: 15px; overflow-wrap: anywhere; }
.l10-graph-labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; align-items: center; }
.l10-graph-labels span { background: var(--step); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.l10-graph-labels code { font: 12px var(--mono); color: var(--quiet); }
.l10-graph-panel table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.l10-graph-panel th, .l10-graph-panel td { text-align: left; vertical-align: top; padding: 3px 8px 3px 0;
                                          border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.l10-graph-panel th { color: var(--quiet); font-weight: 500; white-space: nowrap; }
.l10-graph-do { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 600px) {
  .l10-graph-canvas { height: var(--l10-graph-height, 420px); }
  .l10-graph-panel { top: auto; bottom: 12px; max-height: 55%; }
}
