Skip to content

armgit / kanzo

Public Imported from GitHub
0

Self-hosted, sharable kanban for humans and agents. One 4.7 MB binary, 5 MB of RAM, 10 to 60 tokens per agent reply, starts in 3 ms, zero setup.

44.3 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kanzo</title>
<link rel="icon" href="/logo.png">
<link rel="manifest" href="/manifest.webmanifest">
<link rel="apple-touch-icon" href="/icon.png">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f9f9f9">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000">
<style>
:root {
  --bg: #ffffff; --sidebar: #f9f9f9; --col: #f7f7f7; --card: #ffffff; --card-hover: #f4f4f4; --panel: #ffffff;
  --field: #f4f4f4; --hover: #ececec; --active: #e5e5e5; --menu: #ffffff;
  --text: #0d0d0d; --muted: #5d5d5d; --faint: #8f8f8f; --border: #e5e5e5; --card-border: #ebebeb;
  --accent: #0d0d0d; --accent-text: #ffffff; --danger: #dc2626; --danger-bg: rgba(220, 38, 38, .08);
  --waits: #b45309; --link: #2563eb; --code: #f2f2f2; --shadow: 0 10px 30px rgba(0,0,0,.12);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --sidebar: #000000; --col: #0b0b0b; --card: #171717; --card-hover: #1e1e1e; --panel: #0b0b0b;
    --field: #171717; --hover: #1a1a1a; --active: #242424; --menu: #1c1c1c;
    --text: #ececec; --muted: #a1a1a1; --faint: #6e6e6e; --border: #1f1f1f; --card-border: transparent;
    --accent: #ffffff; --accent-text: #000000; --danger: #f87171; --danger-bg: rgba(248, 113, 113, .1);
    --waits: #f5a524; --link: #7ab7ff; --code: #1c1c1c; --shadow: 0 10px 30px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--active) transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 ui-sans-serif, -apple-system, system-ui, "Segoe UI", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: 260px minmax(0, 1fr); overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
/* No focus rings: fields and buttons show focus with their background instead. */
:focus { outline: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.icon { display: inline-flex; flex: none; }
.icon svg { width: 18px; height: 18px; display: block; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

aside {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; padding: 12px 8px;
}
.brand { font-weight: 600; font-size: 17px; padding: 4px 10px 16px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; margin: -4px 0; }
.brand .ghost { width: auto; margin: -6px 0 -6px auto; padding: 6px; color: var(--muted); }
.brand .ghost:hover, .brand .ghost:focus-visible { color: var(--text); }
.brand .ghost + .ghost { margin-left: 0; }
.syncing svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.nav { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ghost, .nav a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: inherit; text-align: left; text-decoration: none; white-space: nowrap;
}
.ghost:hover, .ghost:focus-visible, .nav a:hover, .nav a:focus-visible { background: var(--hover); }
.nav a.active { background: var(--active); }
.nav a .name { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav a .count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav .label { color: var(--faint); padding: 18px 10px 6px; }
.nav .item { position: relative; }
.nav .more {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none;
  width: 28px; height: 28px; padding: 5px; border: 0; border-radius: 8px; background: none; color: var(--muted);
}
.nav .more:hover, .nav .item.menu-open .more { color: var(--text); }
.nav .item:hover .more, .nav .item:focus-within .more, .nav .item.menu-open .more { display: block; }
.nav .item:hover .count, .nav .item:focus-within .count, .nav .item.menu-open .count { visibility: hidden; }
.nav .item.menu-open a { background: var(--hover); }
.nav .item.renaming { display: flex; align-items: center; gap: 10px; padding: 3px 6px 3px 10px; }
.nav .item.renaming .field { padding: 5px 8px; border-radius: 8px; }
@media (hover: none) { .nav .more { display: block; } .nav .item .count { visibility: hidden; } }
.menu, .bulk {
  position: fixed; z-index: 30; min-width: 190px; padding: 6px; background: var(--menu);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; text-align: left;
}
.menu button:hover, .menu button:focus-visible { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu .label { color: var(--faint); font-size: 12px; padding: 4px 10px 0; }
.menu .swatches { display: flex; gap: 6px; padding: 8px 10px 10px; }
.menu .swatch {
  width: 20px; height: 20px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; transition: transform .1s;
}
.menu .swatch:hover, .menu .swatch:focus-visible { transform: scale(1.15); }
.menu .swatch .icon svg { width: 13px; height: 13px; stroke-width: 3; }
.menu .sep { height: 1px; background: var(--border); margin: 0 4px 6px; }
.menu .repos { display: flex; flex-direction: column; gap: 2px; padding: 6px 6px 10px; }
.menu .repo { display: flex; align-items: center; gap: 6px; padding: 2px 0 2px 4px; }
.menu .repo .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.menu .repo .unlink { width: auto; padding: 4px; color: var(--faint); }
.menu .repo .unlink:hover { color: var(--danger); background: var(--danger-bg); }
.menu .repo .unlink .icon svg { width: 14px; height: 14px; }
.menu .repos input { margin-top: 4px; padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.menu button.danger:hover, .menu button.danger:focus-visible { background: var(--danger-bg); }
.update { margin-top: 8px; background: var(--hover); }
.update:hover, .update:focus-visible { background: var(--active); }
.update:disabled { opacity: .6; cursor: default; }
#settings { margin-top: 8px; color: var(--muted); }
#settings:hover, #settings:focus-visible, #settings.open { color: var(--text); }
.menu .value { margin-left: auto; padding-left: 12px; color: var(--faint); font-size: 12px; }

input.field, textarea.field, select.field {
  background: var(--field); border: 0; border-radius: 12px; padding: 8px 12px; width: 100%;
}
.field::placeholder, .inline::placeholder { color: var(--faint); }
select.field {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
select.field:hover { background-color: var(--hover); }
.btn {
  border: 0; background: var(--hover); border-radius: 99px; padding: 7px 16px; font-weight: 500;
}
.btn:hover, .btn:focus-visible { background: var(--active); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover, .btn.primary:focus-visible { opacity: .85; }

main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
header {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px 14px; flex-wrap: wrap; min-height: 64px;
}
header .info { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; flex: 1 1 240px; min-width: 0; }
header h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
header .sub { color: var(--muted); white-space: nowrap; }
header .repo-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; padding: 3px 10px 3px 8px;
  border-radius: 99px; background: var(--hover); color: var(--muted); font-size: 12.5px; text-decoration: none;
}
header .repo-link:hover, header .repo-link:focus-visible { background: var(--active); color: var(--text); }
header .repo-link .icon svg { width: 14px; height: 14px; }
#network, #human-only, #view { width: auto; height: 35px; min-width: 35px; padding: 0 8px; justify-content: center; border-radius: 99px; }
#network { gap: 6px; color: var(--muted); font-size: 13px; }
#network:hover, #network:focus-visible, #network.open { color: var(--text); }
#network.on { padding: 0 12px 0 10px; background: color-mix(in srgb, #2f9e44 14%, transparent); color: #2f9e44; font-weight: 500; }
#network .count {
  min-width: 18px; padding: 0 5px; border-radius: 99px; background: color-mix(in srgb, currentColor 18%, transparent);
  font-size: 11.5px; line-height: 18px; text-align: center;
}
#new-task { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; }
#new-task .icon svg { width: 16px; height: 16px; }
.query { position: relative; display: block; }
.query[hidden] { display: none; }
.query input { position: relative; display: block; color: transparent; caret-color: var(--text); }
.query input::placeholder { color: var(--faint); }
.query input::selection { color: transparent; background: color-mix(in srgb, var(--link) 30%, transparent); }
.query-mirror {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; overflow: hidden;
  color: var(--text); line-height: normal; pointer-events: none;
}
.query-mirror > span, .chip > span:first-child { white-space: pre; }
/* Room to scroll as far as the input does, with its clear button. */
.query-mirror > span { padding-right: 40px; }
/* Color only, no weight or padding: the text has to stay exactly under the input's caret. */
.qualifier-key { color: var(--link); }
.chip .qualifier-key { font-weight: 600; }
/* Stops where the input's text does, before its clear button. */
#filter-box .query-mirror { padding: 0 15px; font-size: 13px; clip-path: inset(0 28px 0 0); }
#filter {
  width: 180px; height: 35px; padding: 0 14px; border: 1px solid var(--border); border-radius: 99px;
  background: transparent; font: inherit; font-size: 13px; outline: none;
}
#filter:focus { border-color: var(--link); }
#filter.on { border-color: var(--link); background: color-mix(in srgb, var(--link) 8%, transparent); }
#filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 12px; border-radius: 99px;
  background: color-mix(in srgb, var(--link) 15%, transparent); color: var(--link); font-size: 13px;
}
.chip button { display: inline-flex; padding: 4px; border: 0; border-radius: 99px; background: none; color: inherit; }
.chip button:hover { background: color-mix(in srgb, var(--link) 20%, transparent); }
.chip .icon svg { width: 13px; height: 13px; }
::highlight(filter), ::highlight(search) { background-color: color-mix(in srgb, var(--link) 25%, transparent); }
#human-only, #view { color: var(--muted); }
#human-only:hover, #human-only:focus-visible, #view:hover, #view:focus-visible { color: var(--text); }
#human-only[aria-pressed="true"], #view[aria-pressed="true"] { background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); }
#human-only[aria-pressed="true"]:hover, #human-only[aria-pressed="true"]:focus-visible, #view[aria-pressed="true"]:hover, #view[aria-pressed="true"]:focus-visible {
  background: color-mix(in srgb, var(--link) 22%, transparent);
}
.columns {
  flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 12px; padding: 0 24px 24px; overflow-x: auto;
}
.column {
  background: var(--col); border-radius: 18px; display: flex; flex-direction: column; min-height: 0;
}
.column h2 {
  font-size: 13px; font-weight: 600; text-transform: capitalize; color: var(--muted);
  margin: 0; padding: 14px 16px 10px; display: flex; align-items: center; gap: 8px;
}
.column h2 .count { color: var(--faint); font-weight: 400; }
.status-icon { display: inline-flex; flex: none; }
.status-icon svg { width: 14px; height: 14px; display: block; }
.column h2 .collapse {
  margin: -6px -6px -6px auto; width: 30px; height: 30px; padding: 6px; border: 0; border-radius: 8px;
  background: none; color: var(--faint);
}
.column h2 .collapse:hover, .column h2 .collapse:focus-visible { background: var(--hover); color: var(--text); }
.column.collapsed { cursor: pointer; }
.column.collapsed:hover { background: var(--hover); }
.column.collapsed h2 { writing-mode: vertical-rl; padding: 12px 0; align-items: center; gap: 10px; }
.column.collapsed h2 .collapse { margin: 0 0 4px; order: -1; }
.column.collapsed .cards { display: none; }
.cards { flex: 0 1 auto; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 10px 12px;
  cursor: grab; user-select: none; transition: background .1s;
}
.card:hover { background: var(--card-hover); }
.card.open { background: var(--active); }
html:not([data-hide~="waiting"]) .card.waiting:not(:hover) { opacity: .6; }
.list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px 24px; display: flex; flex-direction: column; gap: 4px; }
.list > * { flex-shrink: 0; }
.list h2 { display: flex; gap: 8px; margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.list h2:first-child { margin-top: 0; }
.list h2 .count { color: var(--faint); font-weight: 400; }
.card.row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 12px; border-radius: 10px; cursor: pointer; }
.row .head { flex: 1; min-width: 0; }
.row .tags { margin: 0; flex-shrink: 0; max-width: 40%; flex-wrap: nowrap; overflow: hidden; }
#list-tools { display: flex; gap: 6px; }
#list-tools select { width: auto; height: 35px; padding: 0 28px 0 12px; border-radius: 99px; font-size: 13px; }
/* The label sits over the select, so that clicking anywhere on the pill opens it. */
.pick { position: relative; display: inline-flex; }
.pick span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; white-space: nowrap; pointer-events: none; }
#list-tools #list-sort { padding-left: 64px; }
#list-tools #list-group { padding-left: 75px; }
.card.selected { box-shadow: inset 0 0 0 2px var(--link); }
.marquee { position: fixed; z-index: 9; pointer-events: none; background: color-mix(in srgb, var(--link) 15%, transparent); }
.bulk { padding-left: 14px; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 16px); }
.bulk .field { width: 120px; padding: 5px 12px; }
.bulk select { text-transform: capitalize; }
.card.dragging { opacity: .4; }
.card.gathered { display: none; }
.card.landing { visibility: hidden; }
.card.flying { position: fixed; z-index: 20; margin: 0; pointer-events: none; }
.stack { position: fixed; left: -9999px; top: 0; isolation: isolate; box-sizing: content-box; padding: 8px 10px 10px 0; }
.stack .card { position: relative; box-sizing: border-box; }
.stack::before, .stack::after { content: ""; position: absolute; z-index: -1; background: var(--card-hover); border: 1px solid var(--active); border-radius: 14px; }
.stack::before { top: 18px; left: 10px; right: 0; bottom: 0; }
.stack::after { top: 13px; left: 5px; right: 5px; bottom: 5px; }
.stack-count { position: absolute; top: 0; right: 2px; min-width: 22px; padding: 2px 6px; border-radius: 99px; background: var(--link); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
.card .head { display: flex; align-items: flex-start; gap: 10px; }
.card .title { overflow-wrap: anywhere; flex: 1; min-width: 0; }
.card .num {
  display: inline-flex; align-items: center; gap: 5px; flex: none; margin-top: 2px;
  color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; cursor: copy;
}
.card .num:hover, #p-key:hover { color: var(--text); }
#p-key { cursor: copy; }
.card .num .dot { width: 6px; height: 6px; }
.card .tags, .result .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.card .human-mark { flex: none; margin-top: 1px; color: var(--muted); display: inline-flex; }
.card .human-mark .icon svg { width: 15px; height: 15px; }
.human-field { display: flex; align-items: center; gap: 10px; }
.props .human-field .hint { color: var(--faint); font-size: 12px; }
.switch { position: relative; display: inline-flex; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch span { flex: 1; border-radius: 99px; background: var(--active); transition: background .15s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.switch input:checked + span { background: #3b82f6; }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 2px var(--hover); }
.card .desc, .result .desc {
  display: block; margin-top: 2px; color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  background: var(--hover); border-radius: 99px; padding: 1px 9px 1px 8px;
}
.tag .dot { width: 6px; height: 6px; }
.waits { display: inline-flex; align-items: center; gap: 4px; color: var(--waits); font-size: 12px; font-weight: 500; }
.waits .icon svg { width: 12px; height: 12px; }
.tag.url { gap: 4px; color: var(--text); text-decoration: none; }
.tag.url:hover { background: var(--active); }
.tag.url .icon svg { width: 12px; height: 12px; }
.drop-line { height: 2px; background: var(--text); border-radius: 2px; margin: -4px 4px; }
.empty {
  margin: auto; text-align: center; color: var(--muted); max-width: 380px; padding: 40px 20px;
}
.empty h1 { color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--panel-width, 500px), 100vw); background: var(--panel);
  border-left: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .18s ease-out;
  z-index: 10;
}
.panel.shown { transform: none; }
.panel .top { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px 20px; }
.panel .top .key { color: var(--muted); }
.panel .top .spacer { flex: 1; }
.panel .top .ghost, .bulk .ghost { width: auto; padding: 6px; color: var(--muted); }
.panel .top .ghost:hover, .bulk .ghost:hover { color: var(--text); }
.panel .top .ghost.danger:hover, .bulk .danger:hover { color: var(--danger); background: var(--danger-bg); }
.panel .project-pick select {
  appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0; margin: 0;
  font-size: inherit; color: inherit; cursor: pointer; field-sizing: content;
}
.panel .project-pick:hover, .panel .project-pick:focus-within { background: var(--active); color: var(--text); }
.panel-edge { position: absolute; top: 0; bottom: 0; left: 0; width: 6px; cursor: col-resize; }
.panel-edge:hover { background: var(--active); }
.panel .body { overflow-y: auto; padding: 8px max(20px, calc(50% - 430px)) 24px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
/* The body scrolls instead; without this a long task squeezes the title and textareas to nothing. */
.panel .body > * { flex-shrink: 0; }
.panel .inline {
  border: 0; background: none; padding: 6px 10px; margin: -6px -10px; border-radius: 10px;
  width: calc(100% + 20px); resize: none; overflow: hidden; display: block;
}
.panel .inline:hover, .panel .inline:focus { background: var(--hover); }
.panel .desc-view { cursor: text; }
.panel .title-input { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.props { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; align-items: center; color: var(--muted); }
.props select { width: auto; padding: 4px 30px 4px 12px; border-radius: 99px; text-transform: capitalize; }
.props span { color: var(--text); }
.props > [data-prop] { display: contents; }
[data-hide~="description"] .desc, [data-hide~="description"] [data-prop="description"],
[data-hide~="tags"] [data-prop="tags"], [data-hide~="url"] [data-prop="url"],
[data-hide~="human"] .human-mark, [data-hide~="human"] [data-prop="human"],
[data-hide~="waiting"] .waits, [data-hide~="waiting"] [data-prop="waiting"],
[data-hide~="created"] [data-prop="created"],
[data-hide~="updated"] [data-prop="updated"],
[data-hide~="comments"] .result .comments, [data-hide~="comments"] [data-prop="comments"],
[data-hide~="images"] .panel .thumbs { display: none; }
.links { display: flex; flex-wrap: wrap; gap: 4px; }
#p-waits-links:not(:empty) { margin-top: 8px; }
.waits-field { display: block; position: relative; }
.suggest { position: absolute; z-index: 5; top: calc(100% + 10px); left: -10px; right: -10px; max-height: 280px; padding: 4px; background: var(--menu); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.suggest .result { align-items: center; padding: 6px 8px; }
.suggest .result.selected { background: var(--active); }
.suggest .result .title { flex: 1; min-width: 0; }
.suggest .result .meta { margin: 0; }
.suggest .result .mono { flex: none; color: var(--faint); font-size: 12px; }
.suggest .note { display: block; padding: 8px; }
.links .tag { border: 0; max-width: 100%; }
.links .tag:hover, .links .tag:focus-visible { background: var(--active); }
.links span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.section h3 {
  font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.section h3 .count { color: var(--faint); font-weight: 400; }
.comment { padding: 10px 0; }
.comment:first-child { padding-top: 0; }
.comment .who { font-size: 12px; color: var(--faint); margin-bottom: 2px; display: flex; align-items: center; gap: 4px; }
.comment .remove {
  margin-left: auto; padding: 3px; border: 0; border-radius: 6px; background: none; color: var(--faint);
  visibility: hidden;
}
.comment:hover .remove, .comment .remove:focus-visible { visibility: visible; }
.comment .remove:hover { color: var(--danger); background: var(--danger-bg); }
.comment .remove .icon svg { width: 14px; height: 14px; }
@media (hover: none) { .comment .remove { visibility: visible; } }
.comment .who b { color: var(--text); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
#p-images { margin-top: 10px; }
.composer .thumbs { padding: 12px 12px 0; }
.comment .thumbs { margin-top: 6px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--field); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .remove-image {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 4px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; display: none;
}
.thumb:hover .remove-image, .thumb .remove-image:focus-visible { display: grid; place-items: center; }
.thumb .remove-image .icon svg { width: 14px; height: 14px; }
@media (hover: none) { .thumb .remove-image { display: grid; place-items: center; } }
.section.dropping { background: var(--hover); border-radius: 12px; }
.composer.dropping { background: var(--active); }

.composer { position: relative; margin-top: 6px; background: var(--field); border-radius: 20px; }
.composer textarea {
  display: block; width: 100%; min-height: 84px; max-height: 50vh; resize: none; border: 0; background: none;
  padding: 12px 52px 12px 16px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer .send {
  position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-text);
}
.composer .send:disabled { opacity: .25; cursor: default; }
.composer .send .icon svg { width: 16px; height: 16px; stroke-width: 2.2; }

.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md blockquote { margin: 0 0 .6em; }
.md h1, .md h2, .md h3, .md h4 { margin: .8em 0 .4em; font-size: 15px; }
.md h1 { font-size: 17px; }
.md ul, .md ol { padding-left: 1.3em; }
.md li.check { list-style: none; margin-left: -1.3em; }
.md code { background: var(--code); border-radius: 6px; padding: 1px 5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.md pre { background: var(--code); border-radius: 12px; padding: 10px 12px; overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { border-left: 3px solid var(--active); padding-left: 10px; color: var(--muted); }
.md a { color: var(--link); }

.search-dialog {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
}
.search-window {
  width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--menu); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.search-field { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search-field .icon { color: var(--faint); }
.search-field .query { flex: 1; min-width: 0; }
.search-field input { width: 100%; padding: 0; border: 0; background: none; font-size: 16px; }
.search-field .query-mirror { font-size: 16px; }
.search-field input::-webkit-search-cancel-button { display: none; }
.results { overflow-y: auto; padding: 6px; }
.dialog-window {
  width: min(520px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 18px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.dialog-window h2 { margin: 0; font-size: 17px; font-weight: 600; }
.dialog-window p { margin: 0; color: var(--muted); line-height: 1.45; }
.dialog-window .row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.settings-window {
  width: min(760px, 100%); height: min(460px, 76vh); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.settings-head { display: flex; align-items: center; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--border); }
.settings-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.settings-head .ghost { width: auto; margin-left: auto; padding: 6px; color: var(--muted); }
.settings-head .ghost:hover, .settings-head .ghost:focus-visible { color: var(--text); }
.settings-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; }
#settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--sidebar); border-right: 1px solid var(--border); }
#settings-nav .active { background: var(--active); }
.settings-pane { display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; overflow-y: auto; }
.settings-pane h3 { margin: 0; font-size: 15px; font-weight: 600; }
.settings-pane .setting + h3 { margin-top: 12px; }
.settings-pane p { margin: 0; color: var(--muted); line-height: 1.45; }
.settings-pane .error { color: var(--danger); white-space: pre-line; font-size: 13px; }
.settings-pane .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-pane .row a { color: var(--muted); font-size: 13px; }
.settings-pane .row a:hover { color: var(--text); }
.settings-pane .row .btn { margin-left: auto; }
.settings-pane .btn:disabled { opacity: .6; cursor: default; }
.setting { display: flex; align-items: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.setting .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setting .text span { color: var(--muted); font-size: 13px; }
label.setting { cursor: pointer; }
.setting.disabled, .popover form.disabled { opacity: .5; cursor: default; }
.popover {
  position: fixed; z-index: 30; width: 340px; max-width: calc(100vw - 16px); padding: 16px;
  display: flex; flex-direction: column; gap: 12px; background: var(--menu);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.popover > .setting:first-child { border-top: 0; padding-top: 0; }
.popover form { display: flex; flex-direction: column; gap: 8px; }
.popover .row { display: flex; gap: 8px; }
.popover .row .field { flex: 1; min-width: 0; }
.popover .error { margin: 0; color: var(--danger); font-size: 13px; }
.popover .hint { margin: 0; color: var(--faint); font-size: 12px; }
#network-addresses { display: flex; flex-direction: column; gap: 6px; }
.popover .copy {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 10px;
  background: var(--field); color: var(--text); text-align: left;
}
.popover .copy .mono { flex: 1; font-size: 13px; }
.popover .copy .icon { color: var(--muted); }
.popover .copy:hover .icon, .popover .copy:focus-visible .icon { color: var(--text); }
.popover .copy .icon svg { width: 16px; height: 16px; }
/* One solid red in both themes: dark mode's --danger is a light red for text. */
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger:hover, .btn.danger:focus-visible { background: #dc2626; opacity: .85; }
.guests { display: flex; flex-direction: column; gap: 8px; }
.guests .label { color: var(--muted); font-size: 13px; }
.guest { display: flex; align-items: center; gap: 8px; }
.guest .dot { width: 7px; height: 7px; background: #2f9e44; }
.guest .address { margin-left: auto; color: var(--muted); font-size: 13px; }
.results .label { color: var(--faint); font-size: 12px; padding: 8px 12px 4px; }
.results .note { color: var(--faint); padding: 14px 12px; }
.result {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; text-align: left;
}
.result.selected { background: var(--hover); }
.result.selected .tag { background: var(--active); }
.result .dot { margin-top: 6px; }
.result .body { flex: 1; min-width: 0; }
.result .title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .meta { flex: none; display: flex; align-items: center; gap: 8px; margin-top: 2px; color: var(--faint); font-size: 12px; }
.result .comments { display: inline-flex; align-items: center; gap: 4px; }
.result .comments .icon svg { width: 13px; height: 13px; }

.toast {
  white-space: pre-line; max-width: min(640px, calc(100vw - 32px));
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 9px 16px; border-radius: 99px; z-index: 20; box-shadow: var(--shadow); font-weight: 500;
}
.offline { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; padding: 4px 12px; border-radius: 99px; font-size: 12px; z-index: 20; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  aside { border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .brand { padding-bottom: 6px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { width: auto; }
  .nav .label { display: none; }
  #new-project-toggle, #rail, .panel-edge, #p-wide, .row .tags { display: none; }
  .list { padding: 0 12px 12px; }
  .panel { width: 100vw; }
  .columns { grid-auto-columns: minmax(78vw, 1fr); padding: 0 12px 12px; }
  .settings-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #settings-nav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); }
  header { padding: 12px; }
  #filters { order: 1; }
  #filter-box { order: 1; flex: 1 0 100%; }
  #filter { width: 100%; }
}
/* A page can paint before its script runs: this way a folded sidebar never shows open. */
html:not(.ready) aside { visibility: hidden; }
@media (min-width: 701px) {
  .rail body { grid-template-columns: 52px minmax(0, 1fr); }
  .rail aside .ghost, .rail .nav a { font-size: 0; gap: 0; justify-content: center; padding: 8px 0; }
  .rail .brand { font-size: 0; gap: 12px; flex-direction: column; padding: 4px 0 12px; }
  .rail .brand .ghost { margin: 0; }
  .rail .nav .name, .rail .nav .count, .rail .nav .item .more, .rail .nav .label { display: none; }
}
</style>
</head>
<body>
<aside>
  <div class="brand">
    <img src="/logo.png" alt="">
    Kanzo
    <button class="ghost" id="search-open" title="Search (/ or ⌘K)" aria-label="Search tasks"><span class="icon" data-icon="search"></span></button>
    <button class="ghost" id="rail" title="Toggle the sidebar" aria-label="Toggle the sidebar"><span class="icon" data-icon="sidebar"></span></button>
  </div>
  <button class="ghost" id="new-project-toggle" title="New project"><span class="icon" data-icon="newProject"></span>New project</button>
  <nav class="nav" id="nav"></nav>
  <button class="ghost update" id="update" hidden><span class="icon" data-icon="update"></span><span id="update-label"></span></button>
  <button class="ghost" id="install" title="Use the board as an app of its own" hidden><span class="icon" data-icon="update"></span>Install app</button>
  <button class="ghost" id="settings" title="Settings" aria-haspopup="menu"><span class="icon" data-icon="settings"></span>Settings</button>
</aside>

<main>
  <header>
    <div class="info" id="header"></div>
    <div id="filters"></div>
    <span class="query" id="filter-box" hidden><span class="query-mirror" aria-hidden="true"><span></span></span><input type="search" id="filter" placeholder="Filter board" title="Show only the tasks that match, like tag:bug or -status:done (f)" aria-label="Filter the board" autocomplete="off" spellcheck="false"></span>
    <span id="list-tools" hidden>
      <label class="pick"><span aria-hidden="true">Sort by</span><select class="field" id="list-sort" aria-label="Sort by"><option value="">Board order</option><option value="updated_at">Updated</option><option value="created_at">Created</option><option value="title">Title</option><option value="id">ID</option></select></label>
      <label class="pick"><span aria-hidden="true">Group by</span><select class="field" id="list-group" aria-label="Group by"><option value="">None</option><option value="status">Status</option><option value="project">Project</option><option value="tags">Tag</option></select></label>
    </span>
    <button class="ghost" id="view" title="Show as a list" aria-label="Show as a list" aria-pressed="false" hidden><span class="icon" data-icon="list"></span></button>
    <button class="ghost" id="human-only" title="Show only human tasks (h)" aria-label="Show only human tasks" aria-pressed="false" hidden><span class="icon" data-icon="human"></span></button>
    <button class="ghost" id="network" aria-haspopup="dialog" aria-controls="network-menu"></button>
    <button class="btn primary" id="new-task" title="New task (n)" hidden><span class="icon" data-icon="plus"></span>New task</button>
  </header>
  <div class="columns" id="columns"></div>
  <div class="list" id="list" hidden></div>
</main>

<div class="bulk" id="bulk" hidden>
  <span id="bulk-count"></span>
  <select class="field" id="bulk-status" aria-label="Move to"></select>
  <input class="field" name="add_tags" placeholder="Add tags" autocomplete="off">
  <input class="field" name="remove_tags" placeholder="Remove tags" autocomplete="off">
  <button class="ghost danger" id="bulk-delete" title="Delete" aria-label="Delete"><span class="icon" data-icon="trash"></span></button>
  <button class="ghost" id="bulk-clear" title="Clear (Esc)" aria-label="Clear"><span class="icon" data-icon="close"></span></button>
</div>

<div class="panel" id="panel" aria-hidden="true">
  <div class="panel-edge" id="p-edge"></div>
  <div class="top">
    <span class="key mono" id="p-key"></span>
    <span id="p-project"></span>
    <span class="spacer"></span>
    <button class="ghost danger" id="p-delete" title="Delete task" aria-label="Delete task"><span class="icon" data-icon="trash"></span></button>
    <button class="ghost" id="p-wide" title="Full width" aria-label="Full width"><span class="icon" data-icon="expand"></span></button>
    <button class="ghost" id="p-close" title="Close (Esc)" aria-label="Close"><span class="icon" data-icon="close"></span></button>
  </div>
  <div class="body">
    <textarea class="inline title-input" id="p-title" rows="1" spellcheck="false" placeholder="Task title"></textarea>
    <div class="props">
      Status <span><select class="field" id="p-status"></select></span>
      <div data-prop="tags">Tags <span><input class="inline" id="p-tags" placeholder="Add tags, like bug, ui" autocomplete="off" spellcheck="false"></span></div>
      <div data-prop="url">URL <span><input class="inline" id="p-url" type="url" placeholder="Add a link, like a pull request" autocomplete="off" spellcheck="false"></span></div>
      <div data-prop="human">Human <span class="human-field"><label class="switch"><input type="checkbox" id="p-human" aria-label="Human task"><span></span></label><span class="hint">Agents skip it</span></span></div>
      <div data-prop="waiting">Waits on <span><span class="waits-field"><input class="inline" id="p-waits" placeholder="Type to find a task, or api#12" autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-controls="p-waits-list" aria-expanded="false"><span class="results suggest" id="p-waits-list" role="listbox" hidden></span></span><span class="links" id="p-waits-links"></span></span></div>
      <div data-prop="waiting" id="p-blocks-row">Blocks <span class="links" id="p-blocks"></span></div>
      <div data-prop="created">Created <span id="p-created"></span></div>
      <div data-prop="updated">Updated <span id="p-updated"></span></div>
    </div>
    <div class="section" data-prop="description">
      <h3>Description</h3>
      <textarea class="inline desc-input" id="p-desc" rows="1" placeholder="Add a description (Markdown)"></textarea>
      <div class="inline md desc-view" id="p-desc-view" tabindex="0" role="button" aria-label="Edit description" hidden></div>
      <div class="thumbs" id="p-images"></div>
    </div>
    <div class="section" data-prop="comments">
      <h3>Comments <span class="count" id="p-comment-count"></span></h3>
      <div id="p-comments"></div>
      <form class="composer" id="p-comment-form">
        <div class="thumbs" id="p-pending"></div>
        <textarea id="p-comment" rows="2" placeholder="Add a comment"></textarea>
        <button class="send" id="p-send" type="submit" title="Send (⌘↵)" aria-label="Send comment" disabled><span class="icon" data-icon="send"></span></button>
      </form>
    </div>
  </div>
</div>

<div class="search-dialog" id="settings-dialog" hidden>
  <div class="settings-window" role="dialog" aria-labelledby="settings-title">
    <div class="settings-head">
      <h2 id="settings-title">Settings</h2>
      <button class="ghost" id="settings-close" title="Close (Esc)" aria-label="Close"><span class="icon" data-icon="close"></span></button>
    </div>
    <div class="settings-body">
      <nav id="settings-nav">
        <button class="ghost" data-section="board"><span class="icon" data-icon="board"></span>Board</button>
        <button class="ghost" data-section="sync"><span class="icon" data-icon="sync"></span>Sync</button>
        <button class="ghost" data-section="about"><span class="icon" data-icon="info"></span>About</button>
      </nav>
      <section class="settings-pane" data-section="board">
        <h3>Board</h3>
        <label class="setting">
          <span class="text">Backlog column<span>A column before todo, for tasks agents leave alone</span></span>
          <span class="switch"><input type="checkbox" id="settings-backlog" aria-label="Backlog column"><span></span></span>
        </label>
        <h3>Task properties</h3>
        <p>Turn one off to hide it on the board and leave it out of what agents get. Nothing is deleted.</p>
      </section>
      <form class="settings-pane" data-section="sync" id="sync-form">
        <h3>Sync</h3>
        <p>Keep this board the same on all your machines through a private git repo you own. Use the same repo on each machine.</p>
        <input class="field" id="sync-url" placeholder="https://github.com/you/kanzo-data" autocomplete="off" spellcheck="false" aria-label="Repository URL">
        <p class="error" id="sync-error" hidden></p>
        <div class="row">
          <a id="sync-create" href="https://github.com/new?name=kanzo-data&amp;visibility=private" target="_blank" rel="noopener">Create a private repo on GitHub</a>
          <button class="btn primary" type="submit" id="sync-save">Save and sync</button>
        </div>
      </form>
      <section class="settings-pane" data-section="about">
        <h3>About</h3>
        <div class="setting">
          <span class="text">Version<span id="settings-version"></span></span>
          <button class="btn" id="settings-update">Check for updates</button>
        </div>
        <div class="setting">
          <span class="text">Changelog<span>New features and bug fixes in this version</span></span>
        </div>
        <h3>What's new?</h3>
        <div class="md" id="whats-new"></div>
        <div class="row"><a href="https://github.com/emanuele-em/kanzo/releases" target="_blank" rel="noopener">All releases</a></div>
      </section>
    </div>
  </div>
</div>
<div class="popover" id="network-menu" role="dialog" aria-label="Share" hidden>
  <label class="setting" id="network-share-row">
    <span class="text">Share this board<span id="network-share-note"></span></span>
    <span class="switch"><input type="checkbox" id="network-share" aria-label="Share this board"><span></span></span>
  </label>
  <div id="network-addresses" hidden></div>
  <div class="guests" id="network-guests" hidden></div>
  <form id="network-join">
    <div class="setting">
      <span class="text" id="network-join-text"></span>
      <button class="btn danger" type="button" id="network-leave">Leave</button>
    </div>
    <div class="row" id="network-join-fields">
      <input class="field" id="join-host" placeholder="192.168.0.12" aria-label="Address of the sharing computer" required autocomplete="off" spellcheck="false">
      <button class="btn" type="submit" id="join-submit">Join</button>
    </div>
  </form>
  <p class="error" id="network-error" hidden></p>
  <p class="hint">There are no logins: share only on a network you trust.</p>
</div>
<div class="search-dialog" id="project-dialog" hidden>
  <form class="dialog-window" id="new-project" role="dialog" aria-labelledby="project-title">
    <h2 id="project-title">New project</h2>
    <p>The slug starts each task's key, like api#12.</p>
    <input class="field" name="slug" placeholder="Slug, like api" aria-label="Slug" required autocomplete="off" spellcheck="false" pattern="[a-zA-Z0-9][a-zA-Z0-9\-]{0,31}" title="Letters, digits and -, up to 32">
    <input class="field" name="name" placeholder="Name (optional)" aria-label="Name" autocomplete="off">
    <input class="field" name="repo" placeholder="GitHub owner/repo (optional)" aria-label="GitHub repo" autocomplete="off" spellcheck="false">
    <div class="row">
      <button class="btn" type="button" id="new-project-cancel">Cancel</button>
      <button class="btn primary" type="submit">Create</button>
    </div>
  </form>
</div>
<div class="search-dialog" id="search-dialog" hidden>
  <div class="search-window" role="dialog" aria-label="Search tasks">
    <label class="search-field"><span class="icon" data-icon="search"></span><span class="query"><span class="query-mirror" aria-hidden="true"><span></span></span><input id="search" type="search" placeholder="Search tasks" autocomplete="off" spellcheck="false" aria-label="Search tasks"></span></label>
    <div class="results" id="search-results"></div>
  </div>
</div>

<div class="offline" id="offline" hidden>Board not reachable — is kanzo running?</div>

<script src="/app.js"></script>
</body>
</html>