/* 67 Work. Same tokens as the chat, with the warm accent 67 already uses for news. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #0d0d0d;
  --muted: #5d5d5d;
  --faint: #8f8f8f;
  --line: #e2e5e2;
  --hover: #eceeec;
  --btn: #0d0d0d;
  --btn-text: #ffffff;
  --accent: #466551;
  --accent-bg: #f3f5f3;
  --vip: #dbeafe;
  --vip-text: #1d4ed8;
  --shadow: 0 1px 2px rgba(45, 65, 51, .05), 0 12px 32px rgba(40, 50, 43, .08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121;
    --card: #2a2a2a;
    --text: #ececec;
    --muted: #b4b4b4;
    --faint: #8e8e8e;
    --line: #3a403c;
    --hover: #303632;
    --btn: #ffffff;
    --btn-text: #0d0d0d;
    --accent: #9bc7ac;
    --accent-bg: #303632;
    --vip: #1e3a5f;
    --vip-text: #bfdbfe;
    --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5; min-height: 100dvh;
}
button, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.desk { width: min(840px, 100%); margin: 0 auto; padding: 0 16px calc(24px + var(--safe-bottom)); }
.bar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px;
  margin: 0 -16px; padding: calc(8px + var(--safe-top)) 8px 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
}
.bar-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; position: relative; z-index: 4; }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 14px; background: transparent;
  display: grid; place-items: center; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
/* Chat | Work: same flat, centered control as the chat header (no floating card, no shadow). */
.mode-switch {
  position: absolute; left: 50%; top: calc(16px + var(--safe-top)); transform: translateX(-50%);
  display: flex; gap: 2px; padding: 2px; border-radius: 999px; z-index: 3;
  border: 1px solid var(--line); background: transparent;
  box-shadow: none; flex: none;
}
.mode-switch a {
  text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 650;
  padding: 5px 16px; border-radius: 999px; line-height: 1.2; white-space: nowrap;
}
.mode-switch a:hover { color: var(--text); }
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; row-gap: 6px; padding-bottom: 6px; }
  .bar::after { content: ""; order: 98; flex: 0 0 100%; height: 0; }
  .bar .mode-switch { position: static; transform: none; order: 99; margin: 0 auto; }
  .bar .mode-switch a { padding: 4px 18px; }
}
.mode-switch a[aria-current="page"] { background: var(--hover); color: var(--text); }
.hero { text-align: center; padding: 18px 0 8px; }
.mascot-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 10px; }
.mascot {
  width: 96px; height: 96px; border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-bg), var(--shadow);
  animation: floaty 3.4s ease-in-out infinite;
}
.mascot-wrap.working .mascot { animation: bob 0.55s ease-in-out infinite; }
.mascot-wrap.done .mascot { animation: pop 0.45s ease; }
.dots {
  position: absolute; right: -6px; bottom: 4px; display: flex; gap: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px;
}
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes floaty { 50% { transform: translateY(-5px); } }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-4deg); } }
@keyframes pop { 40% { transform: scale(1.06); } }
@keyframes blink { 50% { opacity: .25; } }
.hero h1 { margin: 0; font-size: 28px; }
.hero p { margin: 8px auto 0; max-width: 42ch; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.chips button, .text-btn {
  border: 1px solid var(--line); background: var(--accent-bg); color: var(--accent);
  border-radius: 999px; padding: 8px 12px; cursor: pointer; font-weight: 600;
}
.quota { text-align: center; color: var(--faint); font-size: 13px; }
.thread { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: min(100%, 640px); }
.msg.user { align-self: flex-end; background: var(--accent-bg); color: var(--text); border-radius: 18px 18px 6px 18px; padding: 10px 12px; }
.msg.agent { align-self: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 12px; box-shadow: var(--shadow); }
.ack { margin: 0 0 8px; font-weight: 700; }
.think-timer { display: inline-flex; align-items: center; margin: -2px 0 8px; padding: 3px 8px; border-radius: 999px; background: var(--accent-bg); color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps .step {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 8px 10px; border-radius: 12px;
  background: #f3f5f3; color: #3f2212;
  font-size: 14px; line-height: 1.35; font-weight: 650;
}
.steps .mark {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffffff; color: #466551;
}
.steps .mark svg { display: block; }
.steps .step.active .mark { animation: blink 1s ease-in-out infinite; }
.steps .step-label { flex: 1; min-width: 0; color: inherit; }
.reply p { margin: 0 0 8px; }
.reply h3 { margin: 8px 0 4px; font-size: 18px; }
.preview { margin-top: 8px; border: 1px dashed var(--line); border-radius: 16px; overflow: hidden; }
.preview header, .frame-note { padding: 8px 12px; color: var(--faint); font-size: 12px; }
.frame-wrap { background: #fff; }
.frame-wrap iframe { width: 100%; height: 380px; border: 0; display: block; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { border-top: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.files button, .files .file-download { border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; text-decoration: none; border-radius: 999px; padding: 7px 10px; cursor: pointer; }
.composer { position: sticky; bottom: 10px; z-index: 2; margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 10px; box-shadow: var(--shadow); }
.composer textarea { width: 100%; border: 0; background: transparent; resize: vertical; outline: none; }
.ask-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tool-btn {
  width: 36px; height: 36px; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none;
}
.tool-btn:hover { background: var(--hover); color: var(--accent); }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  margin: 0 0 6px; padding: 4px 8px 4px 10px; border-radius: 999px;
  background: #f3f5f3; color: #466551; font-size: 13px; font-weight: 650;
}
.file-chip[hidden] { display: none !important; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.photo-strip[hidden] { display: none !important; }
.photo-thumb { position: relative; width: 60px; height: 60px; border-radius: 12px; overflow: hidden; background: var(--hover); border: 1px solid var(--line); flex: none; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; color: var(--muted); padding: 2px; text-align: center; word-break: break-all; }
.photo-thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .58); color: #fff; font-size: 11px; line-height: 20px; padding: 0; cursor: pointer; }
.photo-count { align-self: center; font-size: 12px; color: var(--muted); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
#runBtn { background: var(--btn); color: var(--btn-text); border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
#runBtn:disabled { opacity: .45; }
.out-card {
  margin-top: 16px; padding: 18px 16px 14px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rise .35s ease;
}
.out-card h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.03em; }
.out-card p { margin: 0 0 14px; color: var(--muted); }
.out-card a {
  display: block; text-align: center; text-decoration: none; font-weight: 750;
  background: var(--vip); color: var(--vip-text); border-radius: 14px; padding: 12px;
}
@keyframes rise { from { transform: translateY(18px); } to { transform: none; } }
.banner { color: var(--accent); }
.backdrop { position: fixed; inset: 0; background: rgba(28, 16, 8, .45); z-index: 20; }
.sheet-back { position: fixed; inset: 0; background: rgba(28, 16, 8, .55); z-index: 80; }
.drawer {
  position: fixed; z-index: 21; top: 0; left: 0; bottom: 0; width: min(320px, 88vw);
  background: var(--card); padding: calc(12px + var(--safe-top)) 14px 16px;
  transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer h2 { margin: 0; font-size: 18px; }
#histList { list-style: none; margin: 12px 0 0; padding: 0; }
#histList button { width: 100%; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 10px; cursor: pointer; }
#histList button:hover { background: var(--hover); }
#histList li { display: flex; gap: 6px; align-items: center; }
#histList .project-open { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#histList .project-delete { flex: none; width: auto; color: var(--text); font-size: .8rem; white-space: nowrap; }
#histList .project-delete:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.sheet {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
  margin: 0 auto; width: min(520px, 100%);
  background: #ffffff; color: #222624; opacity: 1;
  border-radius: 28px 28px 0 0; padding: 8px 16px calc(16px + var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(40, 20, 8, .28);
  animation: rise .22s ease;
}
.sheet-grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 6px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head img { width: 36px; height: 36px; border-radius: 50%; }
.sheet-head h2 { margin: 0; font-size: 22px; }
/* Same display face as the chat homepage headline. Chinese uses ChillKai; English and Japanese keep the serif stack. */
@font-face {
  font-family: "ChillKai";
  src: url("/fonts/chillkai-headings.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020, U+0036-0037, U+4E09, U+4ECA, U+4EC0, U+4E48, U+55E8, U+5927, U+5929, U+60F3, U+6211, U+65E5, U+65B0, U+662F, U+70B9, U+804A, U+95EE, U+95FB, U+FF0C, U+FF1F;
}
@font-face {
  font-family: "ChillKai";
  src: url("/fonts/chillkai-work.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+505A, U+529B, U+591A, U+6C14, U+7528, U+8BA9;
}
.hero h1, .sheet-head h2 {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-weight: 560;
  font-style: normal;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
:lang(zh) .hero h1, :lang(zh) .sheet-head h2 {
  font-family: "ChillKai", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
:lang(zh) .hero h1 { font-size: 30px; }
.set-card { margin: 16px 0 10px; border: 1px solid #e0e5e1; border-radius: 18px; background: #ffffff; overflow: hidden; }
.set-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 14px; border: 0; border-top: 1px solid #e5e8e5; background: transparent;
  cursor: pointer; text-align: left;
}
.set-row:first-child { border-top: 0; }
.set-row:hover, .set-row[aria-expanded="true"] { background: #f3f5f3; }
.set-row:focus-visible { outline: 2px solid #466551; outline-offset: -2px; }
.set-k { font-weight: 720; letter-spacing: -0.02em; }
.set-v { display: inline-flex; align-items: center; gap: 4px; color: #466551; font-weight: 650; font-size: 14px; min-width: 0; }
.set-v span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.pop {
  position: fixed; z-index: 100; margin: 0; padding: 6px;
  width: min(320px, calc(100vw - 24px));
  border-radius: 18px; border: 1px solid rgba(45, 65, 51, .14);
  background: rgba(255, 253, 251, .94);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(40, 20, 8, .18);
  animation: popIn .16s ease;
}
.pop[hidden] { display: none !important; }
.pop-opt {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border: 0; border-radius: 12px; background: transparent;
  cursor: pointer; text-align: left;
}
.pop-opt:hover, .pop-opt:focus-visible { background: rgba(45, 65, 51, .08); }
.pop-opt:focus-visible { outline: 2px solid #466551; outline-offset: -2px; }
.pop-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.pop-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: -0.02em; }
.pop-desc { color: #667069; font-size: 12.5px; line-height: 1.35; }
.pop-cost { flex: none; color: #67746c; font-size: 12px; font-weight: 650; }
.pop-check { flex: none; color: #466551; }
.crown { display: inline-grid; place-items: center; width: 16px; height: 16px; color: #b45309; }
.reset { display: block; margin: 4px 0 12px; border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }
.reset:focus-visible, .done:focus-visible { outline: 2px solid #466551; outline-offset: 3px; }
@keyframes popIn { from { transform: translateY(6px) scale(.98); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .pop, .sheet { animation: none; }
}
.done { width: 100%; border: 0; border-radius: 16px; padding: 14px; background: #14110f; color: #ffffff; font-weight: 750; cursor: pointer; }
@media (min-width: 760px) {
  .sheet-grab { display: none; }
  .sheet {
    top: 50%; bottom: auto; left: 50%; right: auto; width: min(420px, calc(100% - 48px));
    border-radius: 28px; transform: translate(-50%, -50%);
    animation: cardIn .22s ease;
  }
}
@keyframes cardIn { from { transform: translate(-50%, calc(-50% + 14px)); } to { transform: translate(-50%, -50%); } }
@media (prefers-color-scheme: dark) {
  .steps .step { background: #303632; color: #fde7d4; }
  .steps .mark { background: #241910; color: #9bc7ac; }
  .file-chip { background: #303632; color: #9bc7ac; }
  .sheet, .set-card { background: #272b28; color: #ecf0ed; }
  .set-card { border-color: #3e4540; }
  .set-row { border-top-color: #3e4540; }
  .set-row:hover, .set-row[aria-expanded="true"] { background: #303632; }
  .set-v, .pop-check, .crown { color: #9bc7ac; }
  .pop { background: rgba(38, 42, 39, .94); color: #ecf0ed; border-color: rgba(253, 186, 116, .22); }
  .pop-opt:hover, .pop-opt:focus-visible { background: rgba(253, 186, 116, .12); }
  .pop-desc, .pop-cost { color: #b2bcb4; }
  .done { background: #ecf0ed; color: #222624; }
}
html[data-theme="dark"] .steps .step { background: #303632; color: #fde7d4; }
html[data-theme="dark"] .steps .mark { background: #241910; color: #9bc7ac; }
html[data-theme="dark"] .file-chip { background: #303632; color: #9bc7ac; }
html[data-theme="dark"] .sheet, html[data-theme="dark"] .set-card { background: #272b28; color: #ecf0ed; }
html[data-theme="dark"] .set-card { border-color: #3e4540; }
html[data-theme="dark"] .set-row { border-top-color: #3e4540; }
html[data-theme="dark"] .set-row:hover, html[data-theme="dark"] .set-row[aria-expanded="true"] { background: #303632; }
html[data-theme="dark"] .set-v, html[data-theme="dark"] .pop-check, html[data-theme="dark"] .crown { color: #9bc7ac; }
html[data-theme="dark"] .pop { background: rgba(38, 42, 39, .94); color: #ecf0ed; border-color: rgba(253, 186, 116, .22); }
html[data-theme="dark"] .pop-opt:hover, html[data-theme="dark"] .pop-opt:focus-visible { background: rgba(253, 186, 116, .12); }
html[data-theme="dark"] .pop-desc, html[data-theme="dark"] .pop-cost { color: #b2bcb4; }
html[data-theme="dark"] .done { background: #ecf0ed; color: #222624; }
@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .frame-wrap iframe { height: 280px; }
}

/* Work conversation and project navigation */
.desk {width:100%;padding:0}
.bar {margin:0;padding:8px 18px;border-bottom:1px solid var(--line);min-height:58px;flex-wrap:nowrap}
.bar::after {display:none}
.bar .mode-switch {position:static;transform:none;order:0;margin:0 auto}
.bar-brand {display:none}
.bar-tools {margin:0}
main {width:min(716px,calc(100% - 40px));margin:auto;display:flex;flex-direction:column;min-height:calc(100dvh - 60px);padding:24px 0 12px}
.hero {margin:auto 0;padding:32px 0}
.hero .mascot {animation:none;width:68px;height:68px;box-shadow:none}
.hero .mascot-wrap {width:68px;height:68px}
#projectTitle {font:650 clamp(24px,3vw,32px)/1.4 system-ui,sans-serif;letter-spacing:-.04em;margin:8px 0 18px;padding-bottom:19px;border-bottom:1px solid var(--line);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quota {order:2;font-size:12px;margin:8px 0}
.thread {gap:25px;flex:1;margin:0 0 14px}
.thread:empty {flex:0}
.msg.user {max-width:min(90%,485px);padding:12px 16px;background:var(--accent-bg);overflow-wrap:anywhere;white-space:pre-wrap}
.msg.agent {max-width:100%;border:none;background:none;box-shadow:none;padding:0}
.agent-brand,.work-brand {display:flex;align-items:center;gap:8px;font-weight:650}
.agent-brand::before {content:"";width:28px;height:28px;border-radius:9px;background:center/cover url(/avatar/avatar-96.webp)}
.agent-brand {margin:0 0 12px}
.ack:empty,.work-progress:not(:has(.steps li)):has(.think-timer[hidden]) {display:none}
.work-progress summary {display:flex;align-items:center;gap:8px;width:fit-content;cursor:pointer;list-style:none}
.work-progress summary::-webkit-details-marker {display:none}
.work-progress summary::after {content:"";width:6px;height:6px;border:solid var(--muted);border-width:0 1px 1px 0;transform:rotate(45deg)}
.work-progress[open] summary::after {transform:rotate(225deg)}
.think-timer {margin:0;border:1px solid var(--line);color:var(--muted);background:var(--card)}
.think-timer::before {content:"◷";margin-right:4px}
.steps {gap:0;margin:10px 0 12px}
html .steps .step,html[data-theme] .steps .step {position:relative;background:none;color:var(--muted);border-radius:0;padding:8px 0;font-weight:450}
.steps .step:not(:last-child)::after {content:"";position:absolute;left:8px;top:24px;bottom:-8px;width:1px;background:var(--line)}
html .steps .step .mark,html[data-theme] .steps .step .mark {z-index:1;background:var(--card);color:var(--muted);width:17px;height:17px}
html .steps .step.active .mark {color:var(--accent);background:var(--accent-bg)}
.steps .active .step-label {font-weight:650;color:var(--text)}
.reply:not(:empty) {margin-top:12px}
.composer {margin-top:auto;bottom:max(10px,var(--safe-bottom));padding:12px 14px 10px;box-shadow:0 2px 12px rgba(0,0,0,.07)}
.composer textarea {resize:vertical;min-height:36px}
.drawer {background:var(--accent-bg);overflow:auto}
.work-brand {font-size:21px;padding:8px 6px 24px}
.work-brand img {border-radius:9px}
.work-brand span {font-weight:450}
#newThread {width:100%;background:var(--card);color:var(--text);border-radius:10px}
#histList li:has([aria-current]) {border-radius:12px;background:var(--hover)}
#histList .project-delete {font-size:0;width:32px;height:36px;padding:0}
#histList .project-delete::after {content:"×";font-size:17px}
@media (min-width:900px) {
 .desk {padding-left:228px}
 .drawer {width:228px;transform:none;box-shadow:none;border-right:1px solid var(--line)}
 #drawerClose,#menuBtn,#drawerBackdrop {display:none}
 .bar-brand {display:block}
 .bar .mode-switch {margin:0 8px 0 auto}
 main {padding-top:38px}
}
