/* Loft's page: the same tokens as relay's page (DESIGN.md). Unlike relay's page this is an ordinary document that scrolls,
   under a bar that stays at the top; a task's dialog and the small dialogs float over it. *//* ================= Design tokens =================
   System fonts (SF Pro / PingFang), and one accent color (system blue), used only for things that can be acted on;
   hierarchy comes from background shades and thin dividers, and shadows are only for the floating composer card, popups and the "island". */
:root {
  --canvas: #ffffff;
  --side: #f5f5f7;
  --group: #f5f5f7;
  --fill: #f0f0f2;
  --fill-2: #e8e8ed;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #a1a1a6;
  --sep: rgba(60, 60, 67, .13);
  --sep-strong: rgba(60, 60, 67, .22);
  --accent: #0071e3;
  --accent-press: #0062c4;
  --accent-soft: rgba(0, 113, 227, .1);
  --red: #e5372d;
  --red-soft: rgba(229, 55, 45, .08);
  --green: #1f9e45;
  --elev: #ffffff;
  --shadow-card: 0 0 0 .5px rgba(0, 0, 0, .1), 0 10px 30px -14px rgba(0, 0, 0, .22), 0 2px 6px -2px rgba(0, 0, 0, .06);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .12), 0 18px 48px -12px rgba(0, 0, 0, .28);
  /* Chinese: PingFang on Apple devices, so they never download the bundled Sarasa after it; other devices get that, which
     covers CJK only, so Latin, symbols and emoji still come from the fonts around it */
  --cjk: "PingFang SC", "Hiragino Sans GB", "Sarasa UI SC", "Microsoft YaHei UI", "Microsoft YaHei";
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", var(--cjk), sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", Consolas, "Liberation Mono", var(--cjk), monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);
  /* Each effort level its own colour, cool to warm as it thinks more, and max a gradient through all of them. None is the accent:
     a set level never reads as the model chip beside it */
  --e-low: #15803a; --e-medium: #0a7d8c; --e-high: #5e4fd8; --e-xhigh: #c25400; --e-max: #d1336b;
  --e-all: linear-gradient(90deg, var(--e-low), var(--e-medium), var(--e-high), var(--e-xhigh), var(--e-max));
  color-scheme: light;
}
[data-level="low"] { --lv: var(--e-low); }
[data-level="medium"] { --lv: var(--e-medium); }
[data-level="high"] { --lv: var(--e-high); }
[data-level="xhigh"] { --lv: var(--e-xhigh); }
[data-level="max"] { --lv: var(--e-max); }
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #161617;
    --side: #1d1d1f;
    --group: #1f1f21;
    --fill: #2a2a2d;
    --fill-2: #333336;
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #6e6e73;
    --sep: rgba(235, 235, 245, .1);
    --sep-strong: rgba(235, 235, 245, .18);
    --accent: #2997ff;
    --accent-press: #4aa8ff;
    --accent-soft: rgba(41, 151, 255, .16);
    --red: #ff6961;
    --red-soft: rgba(255, 105, 97, .12);
    --green: #4cd964;
    --elev: #232325;
    --shadow-card: 0 0 0 .5px rgba(255, 255, 255, .1), 0 14px 36px -14px rgba(0, 0, 0, .7);
    --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .12), 0 20px 50px -12px rgba(0, 0, 0, .75);
    --e-low: #4cd964; --e-medium: #40c8e0; --e-high: #9d8cff; --e-xhigh: #ff9f0a; --e-max: #ff6b9a;
    color-scheme: dark;
  }
}
/* A task's state, as a dot before it: waiting is grey, under way is the accent, waiting to be checked is the warning
   orange relay's page uses, done is green */
:root { --st-todo: var(--label-3); --st-doing: var(--accent); --st-review: #d97706; --st-done: var(--green); }
@media (prefers-color-scheme: dark) { :root { --st-review: #ff9f0a; } }

* { box-sizing: border-box; }
/* What scrolls into view, by focus or by a script, stops below the bar rather than under it */
html { background: var(--canvas); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(64px + env(safe-area-inset-top)); }
body {
  margin: 0; color: var(--label); font: 15px/1.6 var(--sans); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
@media (pointer: coarse) { input, textarea, select { font-size: 16px !important; } }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-radius: 8px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--fill); padding: 1px 6px; border-radius: 5px; }

/* ---------- The bar: name, tabs, who is signed in ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep); padding-top: env(safe-area-inset-top);
}
.bar-in {
  display: flex; align-items: center; gap: 22px; height: 52px; max-width: 1280px; margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}
.brand { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 2px; margin-right: auto; }
.tab {
  padding: 5px 12px; border-radius: 8px; color: var(--label-2); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.tab.on { background: var(--fill); color: var(--label); }
.me { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: 14px; }

/* ---------- A page: 我的 and the board wide, the others one narrow column ---------- */
.page { max-width: 768px; margin: 0 auto; padding: 24px max(24px, env(safe-area-inset-right)) 96px max(24px, env(safe-area-inset-left)); }
.page.full { max-width: 1280px; }
.head { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin: 0 auto 0 0; }
.section-title { font-size: 13px; font-weight: 600; color: var(--label-2); margin: 26px 0 8px 14px; letter-spacing: .02em; }
.section-title.first { margin-top: 4px; }
.note { font-size: 13px; color: var(--label-3); }
/* A sentence under a page's title, saying where what it lists comes from */
.lead { margin: -8px 0 18px; font-size: 14px; color: var(--label-2); }
.lead a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.error { color: var(--red); margin: 12px 14px 0; }
.toast {
  position: fixed; z-index: 70; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 16px; border-radius: 12px;
  background: var(--elev); color: var(--label); box-shadow: var(--shadow-pop); font-size: 14px; animation: toast .22s var(--ease);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
/* What went as asked, said in passing: no red dot */
.toast.info::before { content: none; }
@keyframes toast { from { transform: translateX(-50%) translateY(8px); opacity: 0; } }

/* ---------- Controls ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 18px; border: 0; border-radius: 18px;
  background: var(--accent); color: #fff; font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s;
}
.button.big { height: 40px; padding: 0 22px; border-radius: 20px; font-size: 15px; }
.button.quiet { background: var(--fill); color: var(--label); }
.button:disabled { opacity: .4; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 14px; white-space: nowrap; }
.link.danger { color: var(--red); }
.link.muted { color: var(--label-2); }
.link:disabled { opacity: .5; cursor: default; }
.actions { margin-left: auto; display: flex; gap: 16px; }
.icon {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--label-2);
}
/* Hover only where there is a pointer that hovers: on touch it would stay on whatever was last tapped */
@media (hover: hover) {
  .tab:hover { color: var(--label); }
  .button:hover:not(:disabled) { background: var(--accent-press); }
  .button.quiet:hover:not(:disabled) { background: var(--fill-2); }
  .link:hover:not(:disabled), .lead a:hover { text-decoration: underline; text-underline-offset: 2px; }
  .icon:hover { background: var(--fill); color: var(--label); }
}
/* On touch the text buttons keep their look but take a finger-sized area around it */
@media (pointer: coarse) {
  .link { padding: 10px 8px; margin: -10px -8px; }
  .actions { gap: 20px; }
}

.field {
  height: 34px; padding: 0 12px; border: .5px solid var(--sep-strong); border-radius: 9px; background: var(--canvas); outline: none; min-width: 0;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.6; }
select.field { padding-right: 28px; }
.search { position: relative; display: flex; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--label-3); pointer-events: none; }
.search .field { padding-left: 32px; width: 240px; }

.add { display: flex; gap: 10px; margin-top: 14px; }
.add input {
  flex: 1; min-width: 0; height: 36px; padding: 0 14px; border: .5px solid var(--sep-strong); border-radius: 10px;
  background: var(--canvas); outline: none;
}
.add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.avatar {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--fill-2); color: var(--label-2); font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.avatar.big { width: 30px; height: 30px; font-size: 13px; }
.tag { font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.online { background: var(--green); }
.dot.offline { background: var(--label-3); }
.dot.todo { background: var(--st-todo); }
.dot.doing { background: var(--st-doing); }
.dot.review { background: var(--st-review); }
.dot.done { background: var(--st-done); }
.dot.closed { box-shadow: inset 0 0 0 1.5px var(--label-3); }
/* A change claude made on a member's behalf, in the orange of the effort scale's xhigh */
.claude { color: var(--e-xhigh); font-size: 12px; white-space: nowrap; }
.by, .by + .claude { margin-right: 5px; }
.by { font-weight: 500; color: var(--label); }

.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 4px; border-radius: 14px;
  background: var(--canvas); color: var(--label); font-size: 13px; white-space: nowrap;
}
.chip .x { border: 0; background: none; padding: 0; margin-right: -4px; color: var(--label-2); display: inline-grid; }
.chip .x svg { width: 14px; height: 14px; }
.chip.asking { padding: 0 12px; gap: 12px; color: var(--label-2); }
.chip.asking .link { font-size: 13px; }
@media (hover: hover) { .chip .x:hover { color: var(--label); } }
@media (pointer: coarse) { .chip .x { padding: 11px; margin: -11px -15px -11px -9px; } }

/* A segmented control: the chosen one raised */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; border-radius: 7px; padding: 4px 11px; font-size: 13px; color: var(--label-2);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.seg button.on { background: var(--elev); color: var(--label); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #545458; } }
.seg button.ping { animation: ping 2.4s var(--ease); }
@keyframes ping { 0%, 40% { background: var(--accent-soft); color: var(--accent); } }

/* A grouped list, as in the iOS settings */
.list { list-style: none; margin: 0; padding: 0; background: var(--group); border-radius: 12px; overflow: hidden; }
.list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 9px 14px; flex-wrap: wrap; }
.list li + li { border-top: .5px solid var(--sep); }
.list .main { flex: 1; min-width: 0; display: grid; }
.list .sub { font-size: 12.5px; color: var(--label-2); }
.list .empty { color: var(--label-3); font-size: 13.5px; }
.name { font-weight: 500; }
.real { color: var(--label-2); margin-left: 8px; }

/* ---------- 我的: machines, your tasks, and the studio's activity beside them ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; max-width: 1120px; margin: 0 auto; }
.home-main { min-width: 0; }
.machs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mach {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 0;
  background: var(--group); text-align: left; color: var(--label-3); transition: background-color .15s;
}
.mach .main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mach .t { color: var(--label); font-weight: 500; }
.mach .sub { font-size: 12.5px; color: var(--label-2); }
.mach:disabled { cursor: default; }
/* Assigned but not registered: an outline where its card will be, with the line that registers it */
.mach.pending { background: none; outline: 1px dashed var(--sep-strong); outline-offset: -1px; grid-column: 1 / -1; }
.mach .acts { display: inline-flex; gap: 16px; margin-left: 12px; }
.mach .acts .link { font-size: 12.5px; }
.cmd-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; min-width: 0; }
/* Wraps between its words rather than hiding the code and the site off the edge of a phone */
.mach .cmd { min-width: 0; color: var(--label); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.copied { font-size: 12.5px; color: var(--label-2); padding: 0 6px; }
.more { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 14px 0; }
.more .link { font-size: 13px; }
@media (hover: hover) { button.mach:hover:not(:disabled) { background: var(--fill); color: var(--accent); } }

.mini-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); font-weight: 600; padding: 10px 10px 4px; }
.mini-head .n { color: var(--label-3); font-weight: 500; }
.mine .rows { background: var(--group); border-radius: 12px; padding: 4px; }
.rows { display: grid; gap: 1px; }
/* Whatever opens a task is a link to it, looking like the rest of the page rather than like a link */
.row, .card, .line { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
/* A task as one line: number, title, then whose it is */
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: none; text-align: left; transition: background-color .12s;
}
.row .num { color: var(--label-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.row .rt { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .rm { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--label-3); min-width: 0; }
.row .rm .proj { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.flash { animation: rowflash 2.4s var(--ease); }
@keyframes rowflash { 0%, 30% { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); } }
@media (hover: hover) { .row:hover { background: color-mix(in srgb, var(--label) 5%, transparent); } }

.feed { border-left: .5px solid var(--sep); padding-left: 28px; min-width: 0; }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.feed-list .line {
  display: flex; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: left;
  font-size: 13.5px; transition: background-color .12s;
}
.feed-list .main { display: grid; min-width: 0; }
.feed-list .sub { display: flex; min-width: 0; font-size: 12.5px; color: var(--label-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-list .sub .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.feed-list .sub .when { flex: none; margin-left: .3em; }
@media (hover: hover) { .feed-list .line:hover { background: color-mix(in srgb, var(--label) 5%, transparent); } }

/* ---------- 看板 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; border: 0;
  background: var(--fill); color: var(--label-2); font-size: 13px; white-space: nowrap; transition: background-color .12s, color .12s;
}
.filter.on { background: var(--label); color: var(--canvas); }
@media (hover: hover) { .filter:hover:not(.on) { background: var(--fill-2); color: var(--label); } }

.cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--group); border-radius: 14px; padding: 10px; min-height: 160px; transition: box-shadow .15s; }
.col.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 6px 10px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.col-head .n { color: var(--label-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.col-foot { font-size: 12px; color: var(--label-3); padding: 6px 6px 2px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.card {
  display: grid; gap: 8px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: var(--elev); text-align: left;
  box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04); transition: box-shadow .2s;
}
.card.flash { animation: flash 2.4s var(--ease); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft); } 100% { box-shadow: 0 0 0 .5px var(--sep); } }
@media (hover: hover) { .card:hover { box-shadow: 0 0 0 .5px var(--sep-strong), 0 4px 14px -6px rgba(0, 0, 0, .18); } }
.card .t { font-size: 14px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.num { color: var(--label-3); font-weight: 400; margin-right: 4px; font-variant-numeric: tabular-nums; }
.card .m { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--label-2); }
.card .m .proj { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .who-note { font-size: 12px; color: var(--accent); }
/* The phone's one-column-at-a-time switch */
.colpick { display: none; }

.results { list-style: none; margin: 0; padding: 0; background: var(--group); border-radius: 14px; overflow: hidden; }
.results li + li { border-top: .5px solid var(--sep); }
.results .line { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; }
.results .t { flex: 1; min-width: 0; display: grid; }
.results .sub { font-size: 12.5px; color: var(--label-2); }
@media (hover: hover) { .results .line:hover { background: color-mix(in srgb, var(--label) 5%, transparent); } }

/* ---------- A task's dialog, in the middle of the page over what it was opened from ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .28); animation: fade .2s; }
.scrim.top { z-index: 50; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  position: fixed; z-index: 41; left: 0; right: 0; top: 6vh; margin: 0 auto; width: min(880px, calc(100% - 48px));
  max-height: 88dvh; display: flex; flex-direction: column; background: var(--canvas); border-radius: 18px;
  box-shadow: var(--shadow-pop); animation: rise .22s var(--ease); outline: none;
}
@keyframes rise { from { transform: scale(.97); opacity: 0; } }
.detail-head { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px 0 28px; border-bottom: .5px solid var(--sep); flex: none; }
.detail-head .num { margin-right: auto; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { overflow-y: auto; overscroll-behavior: contain; padding: 20px 28px 30px; flex: 1; }
.title-in {
  display: block; width: 100%; border: 0; background: none; font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35;
  padding: 4px 0; outline: none; resize: none; overflow: hidden;
}
.title-in:focus { box-shadow: 0 2px 0 var(--accent); }
.desc-in { display: block; width: 100%; min-height: 96px; margin-top: 8px; resize: none; overflow: hidden; }
.dlg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 32px; }
.dlg-main, .dlg-side { min-width: 0; }
.props { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 8px 0 0; font-size: 14px; }
.props .k { color: var(--label-2); font-size: 12px; margin-top: 8px; }
.props .seg { display: grid; grid-template-columns: 1fr 1fr; }
.props .seg button { justify-content: center; }
.closed-banner { display: flex; align-items: center; gap: 10px; background: var(--fill); border-radius: 10px; padding: 10px 14px; margin-top: 16px; font-size: 14px; }
.closed-banner span { flex: 1; color: var(--label-2); overflow-wrap: anywhere; }
.cta { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 22px 0 4px; text-align: center; }
.log { list-style: none; margin: 0; padding: 0 0 0 14px; font-size: 13px; color: var(--label-2); display: grid; gap: 8px; }
.log li { display: flex; gap: 8px; align-items: center; }
.log .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log time { color: var(--label-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.close-row { display: flex; align-items: center; gap: 8px; margin-top: 26px; }
.close-row .field { flex: 1; }
.list.convs li { padding: 0; }
.list.convs button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 9px 14px; border: 0; background: none;
  text-align: left; color: var(--label-3);
}
.list.convs .main span:first-child { color: var(--label); }
.list.convs button:disabled { cursor: default; }
.list.convs .empty { padding: 9px 14px; }
@media (hover: hover) { .list.convs button:hover:not(:disabled) { background: color-mix(in srgb, var(--label) 5%, transparent); color: var(--accent); } }

/* ---------- Voice input in a task's fields (voice.tsx) ----------
   A microphone at the end of the field's first line, blue with a square in it while it records. Until the text is in, the
   field's text gives way to a bar on that line, as relay's input box turns into a recorder; the field keeps its size */
.voice-field { position: relative; }
.voice-field > .field { display: block; width: 100%; padding-right: 40px; }
.voice-field.held > .field, .voice-field.held > .field::placeholder { color: transparent; caret-color: transparent; }
.voice-field.held > .field::selection { color: transparent; background: transparent; }
.voice-field .mic {
  position: absolute; top: 3px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--label-2);
}
.voice-field.body .mic { top: 7px; }
/* A finger gets more than the circle */
@media (pointer: coarse) { .voice-field .mic::after { content: ""; position: absolute; inset: -6px; } }
.voice-field .mic:disabled { opacity: .4; cursor: default; }
.voice-field .mic.on { background: var(--accent); color: #fff; }
.voice-field .mic.on:active { transform: scale(.92); }
.voice-field .mic.on i { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
@media (hover: hover) { .voice-field .mic:not(.on):not(:disabled):hover { background: var(--fill); color: var(--label); } }

/* The bar sits where the text was, on the field's first line, in the field's type (a phone's larger one included), and a long
   text or reason fills the field from there */
.voice-bar { position: absolute; left: 1px; top: 1px; right: 36px; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 11px; }
@media (pointer: coarse) { .voice-bar { font-size: 16px; } }
.voice-field.body .voice-bar { bottom: 1px; height: auto; align-items: flex-start; padding: 8px 4px 7px 12px; line-height: 1.6; }
.voice-field.body .voice-bar.rec { bottom: auto; height: calc(1.6em + 16px); align-items: center; padding-top: 0; padding-bottom: 0; }
.voice-bar .link { flex: none; line-height: inherit; }
.voice-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; animation: breathe 1.1s ease-in-out infinite; }
.voice-bar .tm { font-size: 14px; color: var(--label-2); font-variant-numeric: tabular-nums; flex: none; }
.voice-bar canvas { flex: 1; min-width: 0; height: 20px; margin-left: 2px; color: var(--accent); }
@keyframes breathe { 50% { opacity: .25; transform: scale(.75); } }

/* Turning into text: it comes in as typed text would, but grey, behind a breathing dot; the start of a long one leaves first */
.voice-bar .tx { flex: 1; min-width: 0; align-self: stretch; overflow: hidden; }
.voice-bar.busy .tx { display: flex; align-items: center; justify-content: flex-end; color: var(--label-2); white-space: nowrap; }
/* The space after it keeps a short text at the start, while a long one runs out over the start */
.voice-bar.busy .tx::after { content: ""; flex: 1 1 0; }
.voice-bar.busy .tx > span { flex: none; }
.voice-field.body .voice-bar.busy .tx { flex-direction: column; align-items: stretch; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-bar.busy .tx.wait { color: var(--label-3); }
.voice-bar.busy .tx > span::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%;
  background: var(--accent); vertical-align: 1px; animation: breathe 1.1s ease-in-out infinite;
}

/* Failed: the reason in red, cut short on a title's line and wrapped in a description */
.voice-bar.err { color: var(--red); }
.voice-bar.err .tx { font-size: 14px; white-space: nowrap; text-overflow: ellipsis; align-self: auto; }
.voice-field.body .voice-bar.err .tx { white-space: normal; overflow-wrap: anywhere; }
.voice-bar.err > svg { margin-top: 0; }
.voice-field.body .voice-bar.err > svg { margin-top: 4px; }

/* ---------- Small dialogs: a new task, where to open a conversation ---------- */
.modal {
  position: fixed; z-index: 51; left: 0; right: 0; top: 18vh; margin: 0 auto; width: min(440px, calc(100% - 32px));
  background: var(--elev); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 20px; animation: rise .22s var(--ease);
}
.modal h2 { font-size: 17px; font-weight: 650; margin: 0 0 6px; }
.modal p { color: var(--label-2); font-size: 14px; margin: 0 0 14px; }
.modal .form { display: grid; gap: 10px; margin-top: 12px; }
.modal .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.modal .naming { display: flex; align-items: center; gap: 10px; min-width: 0; }
.modal .naming .field { flex: 1; }
.modal .actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 16px; }
.pick { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pick button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 0;
  background: var(--group); text-align: left; color: var(--label-3); transition: background-color .15s;
}
.pick button:disabled { cursor: default; }
@media (hover: hover) { .pick button:hover:not(:disabled) { background: var(--fill); color: var(--accent); } }
.pick .main { flex: 1; min-width: 0; display: grid; color: var(--label); }
.pick .sub { font-size: 12.5px; color: var(--label-2); }
.hint { font-size: 13px; color: var(--label-2); background: var(--fill); border-radius: 10px; padding: 10px 12px; }

/* ---------- 机器 ---------- */
.machine { background: var(--group); border-radius: 14px; padding: 16px 18px 18px; margin-bottom: 14px; }
.machine-head { display: flex; align-items: center; gap: 12px; }
.machine h3 { margin: 0; font-size: 17px; font-weight: 650; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.machine .k { font-size: 12.5px; font-weight: 600; color: var(--label-2); margin: 14px 0 8px; }
.machine .list { background: var(--canvas); }
.add-chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 0; background: none; color: var(--accent); font-size: 13px; transition: background-color .15s; }
.add-chip.on { background: var(--accent-soft); }
@media (hover: hover) { .add-chip:hover { background: var(--accent-soft); } }

/* The menu that opens below a button: frosted, floating, the choice under the pointer in blue */
.menu-box { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 160px; max-height: 280px; overflow-y: auto;
  padding: 5px; border-radius: 12px; display: grid;
  background: color-mix(in srgb, var(--elev) 82%, transparent); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-pop); animation: pop .18s var(--ease); transform-origin: top left;
  /* Scrolled into view while it still opens at 94%, so a margin for the rest */
  scroll-margin-bottom: 16px;
}
.menu button { border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 7px; font-size: 14px; white-space: nowrap; }
@media (hover: hover) { .menu button:hover { background: var(--accent); color: #fff; } }
@media (pointer: coarse) {
  .menu button { padding: 10px 12px; }
  .add-chip { height: 36px; border-radius: 18px; }
  .tab { padding: 9px 14px; }
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* ---------- Sign-in ---------- */
.center { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 24px; text-align: center; }
.center .title { font-size: 40px; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.center .sub { color: var(--label-2); margin: 0 0 22px; }

/* ---------- Narrow screens: the tabs go under the name, the board one column at a time, a task's dialog the whole screen ---------- */
@media (max-width: 760px) {
  .bar-in { flex-wrap: wrap; height: auto; gap: 0 10px; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .brand { display: flex; align-items: center; height: 48px; }
  .me { margin-left: auto; }
  .tabs { order: 3; width: 100%; margin: 0 -4px 8px; }
  html { scroll-padding-top: calc(108px + env(safe-area-inset-top)); }
  .wide { display: none; }
  .page { padding: 16px max(14px, env(safe-area-inset-right)) 64px max(14px, env(safe-area-inset-left)); }
  .machs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mach { padding: 10px 12px; gap: 10px; }
  .mach > svg { display: none; }
  .machine { padding: 14px; }

  .home { grid-template-columns: 1fr; gap: 6px; }
  .feed { border-left: 0; padding-left: 0; }
  .row .rm .proj { display: none; }

  .search { flex: 1 1 100%; order: 4; }
  .search .field { width: 100%; }
  .toolbar .filters { flex: 0 0 calc(100% + 28px); flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px; scrollbar-width: none; }
  .toolbar > select.field { flex: 1; order: 2; }
  .toolbar > .button { order: 3; }
  .toolbar .grow { display: none; }
  .cols { grid-template-columns: 1fr; }
  .col { display: none; }
  .col.show { display: block; }
  .colpick { display: flex; margin-bottom: 12px; }
  .colpick .seg { width: 100%; flex-wrap: nowrap; }
  .colpick .seg button { flex: 1; justify-content: center; padding: 6px 4px; font-variant-numeric: tabular-nums; }

  /* The dialog fills the screen, its parts in reading order */
  .dialog { top: 0; bottom: 0; width: 100%; max-height: none; border-radius: 0; animation: slide .28s var(--ease); }
  @keyframes slide { from { transform: translateY(24px); opacity: 0; } }
  .detail-head { height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left)); }
  .detail-body { padding: 18px max(22px, env(safe-area-inset-right)) max(40px, calc(env(safe-area-inset-bottom) + 24px)) max(22px, env(safe-area-inset-left)); }
  .dlg-grid { display: flex; flex-direction: column; gap: 0; }
  .dlg-main, .dlg-side { display: contents; }
  .p-desc { order: 1; } .p-state { order: 2; } .p-cta { order: 3; } .p-convs { order: 4; } .p-log { order: 5; } .p-close { order: 6; }
  .props { grid-template-columns: 44px minmax(0, 1fr); gap: 12px 10px; margin: 20px 0 6px; align-items: center; }
  .props .k { font-size: inherit; margin-top: 0; }
  .props .seg { display: flex; flex-wrap: nowrap; }
  .props .seg button { flex: 1; justify-content: center; padding: 5px 2px; gap: 5px; }
  .cta { flex-direction: row; align-items: center; gap: 12px; text-align: left; }

  .modal { top: auto; bottom: 0; width: 100%; border-radius: 18px 18px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); animation: sheet .28s var(--ease); }
  @keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
