:root {
  color-scheme: light;
  --desk: #EEF1F4;
  --sheet: #FFFFFF;
  --ink: #1F2A37;
  --pencil: #8A94A3;
  --rule: #E3E7EC;
  --mark: #FFE36E;
  --done: #5E8C6A;
  --blue: #2F5D8A;
  --blue-soft: #EAF0F7;
  --warn: #B4532A;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --gutter: 92px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.6 var(--sans); color: var(--ink); background: var(--desk); font-variant-numeric: tabular-nums; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--pencil); }
.small { font-size: 12px; }
.err { color: var(--warn); min-height: 1.4em; margin: 0; }
code, kbd { font-family: inherit; background: var(--desk); border-radius: 3px; padding: 0 4px; font-size: 12px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.btn { border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 5px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--pencil); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:disabled { opacity: .4; cursor: default; }
.btn.ghost { border-color: transparent; color: var(--blue); }
.link { border: 0; background: none; color: var(--pencil); cursor: pointer; padding: 0; text-decoration: underline; }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; }
.login-card { background: var(--sheet); padding: 40px 36px; border-radius: 10px; width: 320px; display: grid; gap: 12px; box-shadow: 0 1px 0 var(--rule); }
.login-card .brand { font-size: 32px; margin: 0; }
.login-card p { margin: 0; }
.login-card input { border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; }

/* shell */
:root { --side-w: 248px; --assist-w: clamp(340px, 28vw, 460px); }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--assist-w); height: 100vh; }
.side { padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side-ctx { display: none; flex: 1; min-height: 0; flex-direction: column; gap: 10px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-ctx.on { display: flex; }
.side-ctx .pp-list { border: 0; padding: 0; overflow: visible; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.foot-row #whoami { min-width: 0; }
.side-top { display: grid; gap: 8px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: .08em; }
/* center column top: tabs + search, then the slim bar that follows the tab */
.topbar { display: flex; align-items: center; gap: 16px; padding: 8px 20px; border-bottom: 1px solid var(--rule); }
.topbar .gs-slot { flex: 1; max-width: 320px; margin-left: auto; }
.nav { display: flex; gap: 2px; }
.nav button { border: 0; background: none; font-size: 14px; height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer; color: var(--pencil); }
.nav button:hover { background: rgba(0,0,0,.04); }
.nav button.on { background: var(--desk); color: var(--ink); font-weight: 600; }
.ctxbar { display: none; align-items: center; gap: 8px; padding: 5px 20px; border-bottom: 1px solid var(--rule); min-height: 38px; font-size: 13px; }
.ctxbar.on { display: flex; }
.nb-title { border: 0; background: none; font-weight: 600; font-size: 14px; cursor: pointer; padding: 2px 4px; white-space: nowrap; min-width: 88px; text-align: left; }
.wk-nav { border: 0; background: none; color: var(--pencil); cursor: pointer; font-size: 16px; width: 24px; height: 26px; border-radius: 6px; }
.wk-nav:hover { background: var(--desk); }
.week { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; max-width: 460px; }
.week button { border: 0; background: none; border-radius: 7px; padding: 2px 0 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; position: relative; }
.week button:hover { background: var(--desk); }
.week button .w { font-size: 11px; color: var(--pencil); }
.week button .d { font-size: 14px; font-weight: 600; }
.week button.today .d { background: var(--mark); border-radius: 4px; padding: 0 4px; }
.week button.seen { background: var(--desk); }
.week button.has::after { content: ''; position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--pencil); }
.week button.open::after { background: var(--warn); }
.week button.clash::after { background: #E5484D; }
.small-btn { padding: 2px 10px; font-size: 13px; }
.seg { display: flex; gap: 2px; background: var(--desk); border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 10px; border-radius: 5px; cursor: pointer; font-size: 13px; color: var(--pencil); }
.seg button.on { background: var(--sheet); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
#newNote { margin-left: auto; }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.foot-links { display: flex; justify-content: space-between; }
.keys div { margin: 4px 0; font-size: 13px; }
.today-box { font-size: 12px; display: grid; gap: 2px; }
.tb-sum { color: var(--pencil); margin-bottom: 2px; }
.tb-item { border: 0; background: none; text-align: left; padding: 2px 6px; border-radius: 4px; cursor: pointer; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-item:hover { background: rgba(0,0,0,.05); }
.tb-bd { color: var(--pencil); padding: 0 6px; }

/* mini calendar */
.cal { background: var(--sheet); border-radius: 8px; padding: 10px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.cal-head button { border: 0; background: none; cursor: pointer; color: var(--pencil); padding: 2px 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.cal-grid .wd { color: var(--pencil); font-size: 11px; }
.cal-grid button { border: 0; background: none; border-radius: 4px; padding: 3px 0; cursor: pointer; position: relative; }
.cal-grid button:hover { background: var(--desk); }
.cal-grid button.out { color: #C3CAD3; }
.cal-grid button.today { background: var(--mark); font-weight: 700; }
.cal-grid button.has::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--pencil); }
.cal-grid button.open::after { background: var(--warn); }

/* main + views */
.main { background: var(--sheet); overflow: hidden; display: flex; flex-direction: column; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.on { display: flex; }
.pad { padding: 24px 32px; overflow-y: auto; }
.narrow { max-width: 760px; }
.row { display: flex; gap: 10px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.row input[type=number] { width: 90px; border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; }
textarea, input[type=search] { width: 100%; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; background: var(--sheet); resize: vertical; }
h2 { font-size: 17px; margin: 28px 0 6px; }
h2:first-child { margin-top: 0; }

/* notebook */
.nb-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px; border-bottom: 1px solid var(--rule); }
.nb-title { font-weight: 600; }
.scroller { flex: 1; overflow-y: auto; padding: 0 24px 40vh; scroll-behavior: auto; }
.sentinel { height: 1px; }
.month { margin: 28px 0 4px var(--gutter); font-size: 13px; color: var(--pencil); font-weight: 600; }
.day { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); border-top: 1px solid var(--rule); padding: 8px 0 6px; }
.day .g { padding-top: 1px; cursor: pointer; user-select: none; }
.day .g .n { font-size: 22px; line-height: 1.1; font-weight: 700; display: inline-block; padding: 0 4px; border-radius: 3px; }
.day .g .w { font-size: 12px; color: var(--pencil); margin-left: 4px; }
.day .g .lb { display: block; font-size: 12px; color: var(--blue); margin: 2px 0 0 4px; cursor: text; min-height: 1em; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .g .lb:empty::before { content: "＋标注"; color: transparent; }
.day:hover .g .lb:empty::before { color: #C3CAD3; }
.day.today .g .n { background: var(--mark); }
.day.weekend .g .w { color: var(--warn); }
.day.future.empty .g .n, .day.past.empty .g .n { color: #C3CAD3; font-weight: 500; font-size: 17px; }
.day .body { min-width: 0; }

.ln { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 6px; padding: 1px 0; position: relative; border-radius: 4px; }
.ln:hover { background: #FAFBFC; }
.ln .k { flex: none; width: 48px; display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding-top: 3px; color: var(--pencil); font-size: 13px; }
.ln .ck { width: 15px; height: 15px; border: 1.5px solid #B9C1CC; border-radius: 50%; background: none; padding: 0; cursor: pointer; flex: none; }
.ln .ck:hover { border-color: var(--done); }
.ln.done .ck { background: var(--done); border-color: var(--done); box-shadow: inset 0 0 0 2px #fff; }
.ln .num { min-width: 14px; text-align: right; }
.ln .t { flex: 1 1 180px; min-width: 0; outline: none; white-space: pre-wrap; word-break: break-word; padding: 1px 2px; }
.ln.ghost .t:empty::before { content: attr(data-ph); color: transparent; }
.day.today .ln.ghost .t:empty::before, .day:hover .ln.ghost .t:empty::before,
.ln.ghost .t:focus:empty::before, .day.open .ln.ghost .t:empty::before { color: #C3CAD3; }
.ln.sub { margin-left: 50px; padding-left: 8px; border-left: 2px solid var(--rule); border-radius: 0 4px 4px 0; }
.ln.sub .k { width: 22px; }
.ln.sub .ck { width: 12px; height: 12px; opacity: 0; }
.ln.sub:hover .ck, .ln.sub.assign .ck, .ln.sub.done .ck, .ln.sub:focus-within .ck { opacity: 1; }
.ln.sub .t { color: #4B5563; font-size: 14px; }
.ln.sub.assign .t { color: var(--blue); }
.ln.sub.done .t { color: var(--pencil); text-decoration: line-through; }
.ln.fold { display: none; }
.ln.done .t { color: var(--pencil); }
.chip.orig { background: none; color: var(--pencil); cursor: default; padding: 0 2px; }
button.more { background: none; border: 0; color: var(--pencil); font-size: 12px; cursor: pointer; padding: 0 4px; white-space: nowrap; }
.ln.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: var(--mark); } 100% { background: transparent; } }
.ln.enter { animation: enter .3s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ln.leaving { transition: opacity .2s, max-height .25s .1s; opacity: 0; max-height: 0 !important; overflow: hidden; }
.ctx .chips-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.ctx li.done { color: var(--pencil); text-decoration: line-through; }
.ln .tm { font-weight: 600; }
.ln .chips { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 2px; flex: none; max-width: 40%; }
.chip { font-size: 12px; border-radius: 10px; padding: 0 8px; background: var(--blue-soft); color: var(--blue); border: 0; cursor: pointer; white-space: nowrap; }
.chip.place { background: #F1F3F5; color: #5B6573; cursor: default; }
.chip.go { background: none; color: var(--pencil); text-decoration: underline; }
.chip.ai { background: none; color: var(--pencil); cursor: default; padding: 0 2px; }
.ln .ops { flex: none; margin-left: auto; display: flex; gap: 2px; align-items: center; padding-top: 1px; opacity: 0; }
.ln:hover .ops, .ln:focus-within .ops, .ln .ops.open { opacity: 1; }
.ln.sub .ops, .ln.ghost .ops { display: none; }
.ln.ghost .t { cursor: text; }
.day.empty { padding: 4px 0 2px; }
.day.empty .ln.ghost { min-height: 0; }
.ops button { border: 0; background: none; color: var(--pencil); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.ops button:hover { background: var(--desk); color: var(--ink); }
.ops input[type=date] { font-size: 12px; border: 1px solid var(--rule); border-radius: 4px; }

/* carry-over */
.carry { margin: 2px 0 8px 54px; border-left: 3px solid var(--mark); padding: 4px 10px; background: #FFFCEB; border-radius: 0 6px 6px 0; }
.carry summary { cursor: pointer; font-size: 13px; }
.carry .ci { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 2px 0; }
.carry .ci .d { color: var(--pencil); font-size: 12px; width: 44px; flex: none; }
.carry .ci .b { flex: 1; min-width: 0; }
.carry .ci button { border: 0; background: none; color: var(--blue); cursor: pointer; font-size: 12px; padding: 0 2px; }
.carry .all { margin-top: 4px; }

/* assistant */
.assist { display: flex; flex-direction: column; min-height: 0; }
.ctx { padding: 16px; border-bottom: 1px solid var(--rule); max-height: 30vh; overflow-y: auto; position: relative; }
.ctx-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: var(--pencil); cursor: pointer; font-size: 18px; line-height: 1; }
.ctx h3 { margin: 0 0 4px; font-size: 16px; }
.ctx .meta { font-size: 12px; color: var(--pencil); margin-bottom: 8px; }
.ctx ul { margin: 6px 0 0; padding-left: 16px; font-size: 13px; }
.ctx li { margin: 2px 0; }
.ctx .sec { font-size: 12px; color: var(--pencil); margin-top: 10px; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 92%; padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; }
.msg.assistant { align-self: flex-start; background: var(--sheet); }
.msg .act { display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--pencil); margin-top: 4px; border-top: 1px dashed var(--rule); padding-top: 4px; }
.msg .act button { border: 0; background: none; color: var(--blue); cursor: pointer; font-size: 12px; padding: 0; }
.msg.wait { color: var(--pencil); }
.msg .steps { font-size: 12px; color: var(--pencil); margin-bottom: 4px; white-space: normal; }
.msg .steps summary { cursor: pointer; }
.msg .steps ul, .msg .live { margin: 2px 0 0; padding-left: 16px; font-size: 12px; color: var(--pencil); white-space: normal; }
.msg .live:empty { display: none; }
.msg .act span { flex: 1; min-width: 0; color: var(--ink); }
.chat-in { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--rule); align-items: flex-end; }
.chat-in textarea { resize: none; min-width: 0; flex: 1; min-height: 56px; max-height: 196px; }
.chat-in .btn { white-space: nowrap; flex: none; }

/* people */
.pp { display: grid; grid-template-columns: 260px minmax(0, 1fr); flex: 1; min-height: 0; }
.pp-list { border-right: 1px solid var(--rule); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pp-list .pi { display: flex; justify-content: space-between; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; width: 100%; }
.pp-list .pi:hover, .pp-list .pi.on { background: var(--desk); }
.pp-list .pi small { color: var(--pencil); }
.pp-detail { padding: 24px 32px; overflow-y: auto; }
.pp-detail h2 { font-size: 22px; margin: 0 0 12px; }
.fields { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 6px 10px; align-items: center; max-width: 520px; font-size: 14px; }
.fields input, .fields textarea { border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; width: 100%; }
.profile { background: var(--desk); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; max-width: 680px; }
.tl { max-width: 680px; }
.tl .tli { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 14px; cursor: pointer; }
.tl .tli:hover { background: #FAFBFC; }
.tl .tli .d { color: var(--pencil); }
.tl .tli.future .d { color: var(--blue); font-weight: 600; }
.empty { color: var(--pencil); }
.sres .tli { cursor: pointer; }

/* import preview */
.prev { font-size: 14px; border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; max-height: 360px; overflow-y: auto; }
.prev .pd { color: var(--pencil); font-size: 12px; margin-top: 6px; }
.prev .sub { padding-left: 20px; color: #4B5563; }

/* toasts + jump */
.toasts { position: fixed; right: calc(clamp(360px, 30vw, 480px) + 20px); bottom: 20px; display: grid; gap: 8px; z-index: 10; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 14px; max-width: 360px; display: flex; gap: 10px; align-items: baseline; }
.toast button { border: 0; background: none; color: var(--mark); cursor: pointer; padding: 0; }
.jump { border: 0; border-radius: 10px; padding: 16px 18px; width: 340px; box-shadow: 0 10px 40px rgba(31,42,55,.18); }
.jump label { display: block; font-size: 13px; color: var(--pencil); margin-bottom: 6px; }
.jump input { width: 100%; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; font-size: 16px; }
.jump::backdrop { background: rgba(31,42,55,.15); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* pictures */
.pics { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pic { border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 6px; line-height: 0; }
.pic img { height: 40px; width: auto; max-width: 80px; object-fit: cover; border-radius: 6px; display: block; }
.pic:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.photo-grid .pic img { height: 96px; width: 100%; max-width: none; }
.msg-pics { margin-bottom: 4px; }
.msg-pics .pic img { height: 64px; max-width: 120px; }
.img-tray { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px 0; border-top: 1px solid var(--rule); }
.pic-up { position: relative; line-height: 0; }
.pic-up img { height: 56px; width: auto; max-width: 96px; object-fit: cover; border-radius: 6px; }
.pic-up.err img { opacity: .4; outline: 1px solid #c33; }
.pic-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; line-height: 18px; padding: 0; border-radius: 50%; border: 0; background: var(--ink); color: #fff; cursor: pointer; font-size: 14px; }
.pic-st { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; line-height: 16px; text-align: center; color: #fff; background: rgba(0,0,0,.5); border-radius: 0 0 6px 6px; }
.assist.drop { outline: 2px dashed var(--blue); outline-offset: -4px; }
.pic-dlg { border: 0; padding: 12px; border-radius: 10px; max-width: min(92vw, 1000px); }
.pic-dlg::backdrop { background: rgba(0,0,0,.6); }
.pic-dlg img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.pic-dlg details { margin-top: 8px; font-size: 13px; color: var(--pencil); }
.pic-dlg .cap { white-space: pre-wrap; margin-top: 4px; }
.pic-close { position: absolute; top: 4px; right: 8px; border: 0; background: none; font-size: 22px; cursor: pointer; }

/* search box next to the logo; focusing it opens the results over the middle column */
.gs-slot { height: 28px; display: flex; align-items: center; }
.gs-slot .gsearch { height: 28px; }
.gsearch { width: 100%; min-width: 0; border: 1px solid var(--rule); border-radius: 14px; padding: 3px 10px; font-size: 13px; background: var(--sheet); }
.gsearch:focus { outline: none; border-color: var(--blue); }
/* focused: the box grows in place over the tabs' right side; results cover the page below the tab bar only */
.topbar { position: relative; }
.topbar .gs-slot { transition: max-width .18s ease; }
body.searching .topbar .gs-slot { max-width: none; }
body.searching .topbar .nav { visibility: hidden; position: absolute; }
body.searching .gsearch { font-size: 15px; height: 32px; border-color: var(--blue); box-shadow: 0 2px 12px rgba(31,42,55,.10); }
body.searching .gs-slot { height: 32px; }
.search-pane { position: fixed; z-index: 20; left: var(--side-w); right: var(--assist-w); top: var(--topbar-h, 49px); bottom: 0;
  background: var(--sheet); padding: 18px 28px 24px; overflow-y: auto; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.search-pane .sp-empty { color: var(--pencil); font-size: 14px; }
.search-pane h4 { margin: 18px 0 6px; font-size: 12px; color: var(--pencil); font-weight: 600; }
.search-pane .hit { display: flex; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.search-pane .hit:hover, .search-pane .hit.on { background: var(--desk); }
.search-pane .hit small { color: var(--pencil); }
.pp-head { display: flex; gap: 6px; }
.pp-head input { flex: 1; min-width: 0; }
.pp-head .btn { padding: 2px 10px; }
.pi.member { padding-left: 24px; }
.pi.member span::before { content: "└ "; color: var(--pencil); }
.pi small.of { margin-left: 6px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.jump select, .jump input + label, .jump select + label { margin-top: 10px; }
.jump select { width: 100%; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; font-size: 16px; background: var(--sheet); }
.members { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }

/* person popover over the notebook */
.pop { position: fixed; z-index: 25; width: 320px; max-height: 70vh; overflow-y: auto; background: var(--sheet); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(31,42,55,.22); padding: 14px 16px; }
.pop h3 { margin: 0 0 4px; font-size: 16px; }
.pop .meta { font-size: 12px; color: var(--pencil); margin-bottom: 6px; }
.pop .sec { font-size: 12px; color: var(--pencil); margin-top: 10px; }
.pop ul { margin: 4px 0; padding-left: 16px; font-size: 13px; }
.pop .x { position: absolute; top: 6px; right: 10px; border: 0; background: none; color: var(--pencil); cursor: pointer; font-size: 18px; }
.pop .row { margin: 8px 0 0; }

/* explicit confirm for the line being edited */
.ln .ok { display: none; flex: none; border: 0; background: var(--ink); color: #fff; border-radius: 4px; font-size: 12px; padding: 1px 10px; margin: 2px 0 0 4px; cursor: pointer; }
.ln.editing .ok { display: inline-block; }
.ln.editing { background: #FAFBFC; box-shadow: inset 2px 0 0 var(--blue); }
.ln .saved { display: none; flex: none; font-size: 12px; color: var(--done); padding-top: 3px; }
.ln.just-saved .saved { display: inline; }

/* detail page drawer */
.chip.page { background: #F1F3F5; color: #5B6573; }
.drawer { position: fixed; z-index: 22; top: 0; bottom: 0; right: clamp(360px, 30vw, 480px); width: min(46vw, 560px); background: var(--sheet);
  border-left: 1px solid var(--rule); box-shadow: -8px 0 24px rgba(31,42,55,.08); display: flex; flex-direction: column; }
.drawer[hidden] { display: none; }
.dr-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px 8px; border-bottom: 1px solid var(--rule); }
.dr-title { font-weight: 600; font-size: 16px; }
.dr-meta { font-size: 12px; color: var(--pencil); }
.dr-x { border: 0; background: none; font-size: 22px; color: var(--pencil); cursor: pointer; align-self: flex-start; }
.dr-scroll { flex: 1; overflow-y: auto; padding: 12px 18px; }
.dr-blocks { display: grid; gap: 12px; align-content: start; }
.dr-info { display: grid; gap: 8px; margin-bottom: 14px; }
.dr-info:empty { display: none; }
.dr-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.dr-row .lab { color: var(--pencil); font-size: 12px; min-width: 30px; }
.dr-kids { border-left: 2px solid var(--rule); padding-left: 10px; display: grid; gap: 2px; }
.dr-kids .lab { color: var(--pencil); font-size: 12px; margin-bottom: 2px; }
.kid { display: flex; gap: 6px; align-items: flex-start; }
.kid .kck { flex: none; width: 13px; height: 13px; margin-top: 6px; border: 1.5px solid #B9C1CC; border-radius: 50%; background: none; padding: 0; cursor: pointer; }
.kid.done .kck { background: var(--done); border-color: var(--done); box-shadow: inset 0 0 0 2px #fff; }
.kid textarea { display: block; flex: 1; min-width: 0; border: 0; outline: none; resize: none; overflow: hidden; font: inherit; font-size: 14px; line-height: 1.6; padding: 1px 2px; background: transparent; color: #4B5563; }
.kid.assign textarea { color: var(--blue); }
.kid.done textarea { color: var(--pencil); text-decoration: line-through; }
.kid-add { justify-self: start; border: 0; background: none; color: var(--pencil); font-size: 12px; cursor: pointer; padding: 2px 0; }
.kid-add:hover { color: var(--ink); }
.dr-empty { color: var(--pencil); font-size: 13px; }
.blk { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; position: relative; }
.blk .bx { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--pencil); cursor: pointer; opacity: 0; }
.blk:hover .bx, .blk:focus-within .bx { opacity: 1; }
.blk textarea { width: 100%; border: 0; outline: none; resize: none; font: inherit; line-height: 1.6; min-height: 72px; background: transparent; }
.blk .bk { font-size: 11px; color: var(--pencil); margin-bottom: 4px; }
.blk audio { width: 100%; }
.blk .tx { white-space: pre-wrap; font-size: 14px; background: var(--desk); border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.blk .tx-h { font-size: 11px; color: var(--pencil); margin-top: 6px; }
.blk img.pv { max-width: 100%; max-height: 260px; border-radius: 6px; cursor: zoom-in; display: block; }
.blk a.fl { display: flex; gap: 8px; align-items: baseline; color: var(--ink); text-decoration: none; }
.blk a.fl:hover { text-decoration: underline; }
.dr-add { display: flex; gap: 6px; align-items: center; padding: 10px 18px 14px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.dr-add button { border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.dr-add button:hover { border-color: var(--pencil); }
.dr-add button.rec { background: #FDECEA; border-color: #E5A29A; color: #B4301F; }
.drawer.drop { outline: 2px dashed var(--blue); outline-offset: -4px; }

.login-card .tabs { display: flex; gap: 4px; background: var(--desk); border-radius: 8px; padding: 3px; }
.login-card .tabs button { flex: 1; border: 0; background: none; padding: 5px 0; border-radius: 6px; cursor: pointer; font-size: 14px; }
.login-card .tabs button.on { background: var(--sheet); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
#whoami { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* first-run tour and the example bar */
.tour { position: fixed; inset: 0; z-index: 40; background: rgba(31,42,55,.35); display: grid; place-items: center; }
.tour[hidden] { display: none; }
.tour-card { background: var(--sheet); border-radius: 12px; width: min(520px, 92vw); padding: 24px 28px 18px; box-shadow: 0 16px 48px rgba(31,42,55,.25); }
.tour-step { font-size: 12px; color: var(--pencil); }
.tour-card h2 { margin: 2px 0 10px; font-size: 20px; }
.tour-body p { margin: 0 0 10px; font-size: 15px; line-height: 1.7; }
.tour-demo { background: var(--desk); border-radius: 8px; padding: 8px 12px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.tour-nav { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tour-dots { flex: 1; display: flex; gap: 5px; justify-content: center; }
.tour-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--rule); }
.tour-dots span.on { background: var(--ink); }
.sample-bar { display: flex; gap: 10px; align-items: center; padding: 7px 24px; background: #FFFBEA; border-bottom: 1px solid var(--rule); font-size: 13px; }
.sample-bar span:first-child { flex: 1; }
.try-box { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; align-items: flex-start; }
.try { border: 1px solid var(--rule); background: var(--sheet); border-radius: 14px; padding: 2px 12px; cursor: pointer; font-size: 13px; color: var(--blue); text-align: left; }
.try:hover { border-color: var(--blue); }

/* ======================================================================== phone (H5)
   Same markup as the desktop. Everything below only applies on narrow screens; the extra phone-only elements
   (.m-top, .m-tabs, .m-dock, .voice, ...) are hidden on desktop. */
.m-top, .m-tabs, .m-dock, .m-fab, .m-sheet-wrap, .m-only, .m-chat-head, .voice, .hold-btn, .pp-back { display: none; }

@media (hover: none) { .ln:hover .ops { opacity: 0; } .ln:hover { background: none; } }

@media (max-width: 760px) {
  :root { --gutter: 54px; --tabbar: 54px; --dock: 56px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
  body { font-size: 16px; -webkit-tap-highlight-color: transparent; }
  input, textarea, select { font-size: 16px; }              /* iOS zooms the page on focus below 16px */
  button { touch-action: manipulation; }

  /* the three columns become: one page, a top bar, a tab bar and a dock */
  .shell { display: block; height: 100dvh; position: relative; }
  .side { display: none; }
  .main { position: absolute; left: 0; right: 0; top: calc(44px + var(--safe-t)); bottom: calc(var(--tabbar) + var(--dock) + var(--safe-b));
          border: 0; }
  .view { min-height: 0; }
  .view.m-only.on { display: flex; }
  .m-only { display: none; }

  .m-top { display: flex; align-items: center; justify-content: space-between; position: absolute; left: 0; right: 0; top: 0;
           height: calc(44px + var(--safe-t)); padding: var(--safe-t) 8px 0; background: var(--sheet); border-bottom: 1px solid var(--rule); z-index: 5; }
  .m-title { font-weight: 700; letter-spacing: .04em; }
  .m-btn { border: 0; background: none; color: var(--blue); font-size: 15px; min-width: 52px; height: 44px; cursor: pointer; }
  .m-tabs { display: flex; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
            background: var(--sheet); border-top: 1px solid var(--rule); z-index: 6; }
  .m-tabs button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
                   font-size: 11px; color: var(--pencil); cursor: pointer; }
  .m-tabs button i { font-style: normal; font-size: 14px; width: 28px; height: 22px; line-height: 22px; border-radius: 11px; text-align: center; }
  .m-tabs button span { font-size: 11px; }
  .m-tabs button.on { color: var(--ink); font-weight: 600; }
  .m-tabs button.on i { background: var(--mark); }

  /* the dock: where you start typing. Tapping it lifts the chat to full screen. */
  .m-dock { display: flex; align-items: center; gap: 8px; position: absolute; left: 10px; right: 10px; z-index: 7;
            bottom: calc(var(--tabbar) + var(--safe-b) + 6px); height: 44px; padding: 0 8px; background: var(--sheet);
            border: 1.5px solid #8C84F0; border-radius: 22px; box-shadow: 0 2px 10px rgba(80,70,200,.12); }
  .m-dock[hidden] { display: none; }
  .m-dock-in, .m-dock-hold { flex: 1; min-width: 0; border: 0; background: none; text-align: left; color: var(--pencil); font-size: 15px; height: 40px; cursor: text; }
  .m-dock-hold { text-align: center; color: var(--ink); font-weight: 600; background: #F2F1FD; border-radius: 18px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  .m-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; background: none; font-size: 18px; cursor: pointer; flex: none; }
  .main { bottom: calc(var(--tabbar) + var(--dock) + var(--safe-b) + 8px); }

  .m-fab { display: block; position: absolute; right: 14px; bottom: calc(var(--tabbar) + var(--dock) + var(--safe-b) + 18px); z-index: 6;
           border: 0; border-radius: 18px; padding: 6px 14px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
  .m-fab[hidden] { display: none; }

  /* the assistant: a full-screen page that slides up from the bottom */
  .assist { position: fixed; inset: 0; z-index: 30; background: var(--sheet); transform: translateY(100%); visibility: hidden;
            transition: transform .24s ease-out, visibility 0s linear .24s; display: flex; flex-direction: column; height: 100dvh; padding-top: var(--safe-t); }
  body.chat-open .assist { transform: none; visibility: visible; transition: transform .24s ease-out; }
  .m-chat-head { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--rule); flex: none; }
  .ctx { display: none; }
  .chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .msgs { padding: 12px 14px; }
  .msg { font-size: 16px; max-width: 88%; }
  .chat-in { padding: 8px 10px calc(8px + var(--safe-b)); gap: 6px; align-items: center; }
  .chat-in textarea { font-size: 16px; min-height: 40px; max-height: 120px; border-radius: 20px; padding: 8px 14px; }
  .chat-in #imgBtn { padding: 6px 10px; }
  .chat-in .hold-btn { display: none; flex: 1; height: 40px; border: 0; border-radius: 20px; background: #F2F1FD; font-size: 15px; font-weight: 600; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  .chat-in.voice-mode textarea { display: none; }
  .chat-in.voice-mode .hold-btn { display: block; }
  .chat-in .m-icon { display: inline-flex; }
  .toasts { right: 10px; left: 10px; bottom: calc(var(--tabbar) + var(--dock) + var(--safe-b) + 20px); }
  .toast { max-width: none; }

  /* notebook */
  .topbar, .ctxbar, .ctxbar.on { display: none; }
  .side-ctx { display: block; overflow-y: auto; margin: 0; }
  #sideNotes { padding: 12px 14px; gap: 6px; display: flex; flex-direction: column; overflow-y: auto; flex: 1; min-height: 0; }
  .nlist .ni { padding: 12px 8px; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .scroller { padding: 0 10px 24px; }
  .day { grid-template-columns: var(--gutter) minmax(0, 1fr); }
  .day .g .n { font-size: 20px; }
  .day .g .w { display: block; margin: 0 0 0 4px; font-size: 11px; white-space: nowrap; }
  .day { padding: 6px 0 4px; }
  .day .g .lb { max-width: 48px; }
  .ln { min-height: 40px; padding: 3px 0; align-items: center; }
  .ln .ck { width: 22px; height: 22px; }
  .ln .ck::after { content: ""; position: absolute; inset: -12px; }     /* a 46px touch target around the 22px circle */
  .ln .ck { position: relative; }
  .ln .k { width: 40px; padding-top: 0; gap: 2px; }
  .ln .num { min-width: 12px; font-size: 12px; }
  .ln.sub { margin-left: 18px; padding-left: 6px; }
  .ln.sub .k { width: 14px; }
  .ln .t { font-size: 16px; padding: 4px 2px; }
  .ln.sub .t { font-size: 15px; }
  .ln .chips { max-width: 100%; }
  .ln .ok { padding: 6px 14px; font-size: 14px; }
  /* tapping a row opens its action bar (instead of hover) */
  .ln .ops { position: static; opacity: 1; display: none; width: 100%; margin: 0 0 4px 46px; gap: 6px; flex-wrap: wrap; }
  .ln.m-open .ops { display: flex; }
  .ln.sub .ops { display: none; }
  .ops button { font-size: 14px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 16px; background: var(--sheet); color: var(--ink); }
  .ops input[type=date] { font-size: 16px; padding: 6px; }
  .month { margin-left: 12px; }

  /* people / places: two levels instead of two columns */
  .pp { grid-template-columns: 1fr; position: relative; }
  .pp-list { border: 0; }
  .pp-detail { position: absolute; inset: 0; background: var(--sheet); transform: translateX(100%); transition: transform .22s ease-out; padding: 56px 16px 24px; z-index: 3; visibility: hidden; }
  .pp.m-detail .pp-detail { transform: none; visibility: visible; }
  .pp-back { display: none; position: absolute; left: 4px; top: 4px; z-index: 4; }
  .pp.m-detail .pp-back { display: block; }
  .pad { padding: 16px; }
  .fields { grid-template-columns: 64px minmax(0, 1fr); }
  .tl .tli { grid-template-columns: 72px minmax(0, 1fr); }

  /* the detail page and the person card */
  .drawer:not(.docked) { right: 0; left: 0; width: auto; top: 0; bottom: 0; z-index: 35; padding-top: var(--safe-t); transform: translateX(100%); transition: transform .22s ease-out; border: 0; display: flex; }
  .drawer:not(.docked)[hidden] { display: flex; visibility: hidden; transform: translateX(100%); }
  .drawer:not([hidden]) { transform: none; visibility: visible; }
  .dr-add { padding-bottom: calc(14px + var(--safe-b)); }
  .dr-add button { padding: 8px 14px; font-size: 15px; }
  .pop { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 70dvh; border-radius: 16px 16px 0 0; padding-bottom: calc(14px + var(--safe-b)); z-index: 45; }

  /* search: full screen */
  body.searching .gsearch { display: none; }
  .search-pane { left: 0; right: 0; top: 0; padding: calc(56px + var(--safe-t)) 14px 24px; z-index: 40; border: 0; }
  .m-search-bar { position: fixed; left: 10px; right: 10px; top: calc(8px + var(--safe-t)); z-index: 41; display: flex; gap: 8px; }
  .m-search-bar input { flex: 1; border-radius: 20px; padding: 8px 14px; }

  /* the day sheet (calendar + what is left today) comes down from the top */
  .m-sheet-wrap { display: block; position: fixed; inset: 0; z-index: 36; }
  .m-sheet-wrap[hidden] { display: none; }
  .m-sheet-bg { position: absolute; inset: 0; background: rgba(31,42,55,.35); }
  .m-sheet { position: absolute; left: 0; right: 0; background: var(--sheet); padding: 12px 14px 16px; }
  .m-top-sheet { top: 0; padding-top: calc(12px + var(--safe-t)); border-radius: 0 0 16px 16px; max-height: 80dvh; overflow-y: auto; }
  .m-top-sheet .cal-grid button { padding: 9px 0; font-size: 15px; }

  .login-card { width: min(92vw, 360px); padding: 28px 22px; }
  .tour-card { padding: 20px 18px 14px; }
  .sample-bar { padding: 7px 12px; flex-wrap: wrap; }
  .m-list { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin: 12px 0; }
  .m-list button { border: 0; background: var(--sheet); text-align: left; padding: 14px 16px; font-size: 16px; }
  .voice { display: block; }
}

/* the push-to-talk sheet (also needs to exist on desktop CSS-wise, but is only ever opened on a phone) */
.voice { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar, 54px) + var(--safe-b, 0px) + 12px); z-index: 60; pointer-events: none;
         transform: translateY(24px); opacity: 0; transition: transform .22s ease-out, opacity .22s ease-out; }
.voice:not([hidden]) { transform: none; opacity: 1; }
.voice-card { position: relative; background: #fff; border-radius: 20px; padding: 14px 18px 22px; min-height: 170px;
              box-shadow: 0 0 0 1.5px #9A92F5, 0 0 24px rgba(120,100,255,.35), 0 10px 40px rgba(31,42,55,.18); }
.voice-title { font-weight: 700; font-size: 14px; }
.voice-title span { font-size: 10px; background: #E6E3FF; color: #5B50D8; border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.voice-msg { text-align: center; color: var(--pencil); margin: 34px 0 22px; font-size: 15px; }
.voice-bars { display: flex; gap: 3px; justify-content: center; align-items: center; height: 26px; }
.voice-bars i { width: 3px; border-radius: 2px; background: #6C63F0; height: 4px; transition: height .08s linear; }
.voice.cancel .voice-card { box-shadow: 0 0 0 1.5px #F0868A, 0 0 24px rgba(240,80,90,.3), 0 10px 40px rgba(31,42,55,.18); }
.voice.cancel .voice-bars i { background: #E5484D; }
.voice.cancel .voice-msg { color: #E5484D; }
.voice.busy .voice-bars i { background: #C3CAD3; height: 4px !important; }

/* desktop: the list of people / places sits in the left column; the view is the page of one */
body:not(.mobile) .pp { grid-template-columns: minmax(0, 1fr); }
.side-ctx .pp-list .pi { padding: 7px 8px; }
.side-ctx .pp-head input, .side-ctx > input[type=search] { font-size: 13px; padding: 6px 10px; border-radius: 14px; }
.nlist { display: flex; flex-direction: column; gap: 1px; }
.nlist .grp { position: sticky; top: 0; background: var(--paper, #fff); padding: 6px 8px 4px; margin: 6px 0 2px; border-bottom: 1px solid var(--rule); z-index: 1; font-size: 12px; color: var(--ink); }
.nlist .fold-head { position: sticky; bottom: 0; background: var(--paper, #fff); }
.nlist .ni { border: 0; background: none; text-align: left; padding: 8px 8px; border-radius: 8px; cursor: pointer; display: grid; gap: 2px; width: 100%; }
.nlist .ni:hover { background: rgba(0,0,0,.04); }
.nlist .ni.on { background: var(--mark); }
.nlist .ni .tt { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nlist .ni .sn { font-size: 12px; color: var(--pencil); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nlist .ni .mt { font-size: 11px; color: var(--pencil); display: flex; gap: 6px; }
.nlist .ni .mt .bad { color: #E5484D; }
.nlist .grp { font-size: 11px; color: var(--pencil); margin: 10px 8px 2px; font-weight: 600; }

/* the detail page docked into the 笔记 tab */
.note-page { padding: 0; display: flex; }
.drawer.docked { position: static; width: auto; flex: 1; min-width: 0; box-shadow: none; border-left: 0; z-index: auto; transform: none; visibility: visible; }
.drawer.docked .dr-x { display: none; }
.dr-del { display: none; align-self: flex-start; margin-top: 4px; color: var(--pencil); }
.drawer.docked.free .dr-del { display: inline; }
.note-title { width: 100%; border: 0; border-bottom: 1px solid var(--rule); font-size: 20px; font-weight: 700; padding: 4px 0 8px; background: none; }
.note-title:focus { outline: none; border-color: var(--blue); }
.kid.ro { padding: 2px 0 2px 4px; font-size: 14px; }
.recog { display: grid; gap: 8px; border-top: 1px dashed var(--rule); padding-top: 10px; margin-top: 4px; }
.recog:empty { display: none; }
.recog > .lab { font-size: 12px; color: var(--pencil); }
.recog-plans { display: grid; gap: 2px; flex: 1; }
.rp { border: 0; background: none; text-align: left; display: flex; gap: 8px; padding: 3px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.rp:hover { background: var(--desk); }
.rp .d { color: var(--pencil); white-space: nowrap; font-size: 13px; min-width: 64px; }
.rp.done .t { text-decoration: line-through; color: var(--pencil); }
.conflict { background: #FFF4F2; border: 1px solid #F3C7C0; border-radius: 8px; padding: 8px 10px; display: grid; gap: 3px; font-size: 13px; }
.conflict .cm { font-weight: 600; color: #B4301F; }
.conflict .cs { color: var(--ink); }
.conflict .cb { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.ln.flash { background: var(--mark); transition: background .3s; }
.chip.note { background: #EEF0FF; color: #4B45B8; border: 0; cursor: pointer; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.clash { background: #FDECEA; color: #B4301F; border: 0; cursor: pointer; font-weight: 600; }
.ln.plan .t { color: #3E4A59; }
.ln.has-clash .ck { border-color: #E5484D; }
#pop .conflict { border: 0; background: none; padding: 0; }
.pic-up.fileup { min-width: 72px; }
.pic-up .fi { height: 56px; min-width: 72px; padding: 6px 8px; border-radius: 6px; background: var(--desk); font-size: 11px; line-height: 1.4; white-space: pre-wrap; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ink); word-break: break-all; }
.msg-file { font-size: 12px; background: rgba(255,255,255,.18); border-radius: 6px; padding: 3px 8px; margin-bottom: 4px; }
.msg.assistant .msg-file { background: var(--desk); }

.nlist .ni.tiny { padding: 5px 8px; opacity: .85; }
.nlist .ni.tiny .sn { display: none; }
.fold-head { border: 0; background: none; text-align: left; font-size: 12px; color: var(--pencil); padding: 10px 8px 4px; cursor: pointer; }
.fold-head:hover { color: var(--ink); }
/* the 文件 tab */
.fcounts { display: grid; gap: 4px; font-size: 13px; }
.fcounts div { display: flex; justify-content: space-between; padding: 3px 6px; color: var(--ink); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; overflow-y: auto; }
.fcard { border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); overflow: hidden; display: grid; grid-template-rows: 110px auto; cursor: pointer; text-align: left; padding: 0; }
.fcard:hover { border-color: var(--pencil); }
.fcard .th { background: var(--desk); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--pencil); overflow: hidden; }
.fcard .th img { width: 100%; height: 100%; object-fit: cover; }
.fcard .nm { padding: 6px 8px 2px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard .wh { padding: 0 8px 7px; font-size: 11px; color: var(--pencil); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard .wh.none { color: #B4301F; }
.fgrid h3 { grid-column: 1 / -1; margin: 8px 0 0; font-size: 12px; color: var(--pencil); font-weight: 600; }
.fgrid .empty { grid-column: 1 / -1; }

.pi.pending { color: var(--accent, #c0392b); font-weight: 600; }
.crumbs { margin-bottom: 6px; }
.crumbs .link { padding: 0; }
.pend { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.pend-h { font-weight: 600; }
.pend-a { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.pend-a input { flex: 1 1 140px; min-width: 120px; font-size: 16px; padding: 5px 8px; }
.pend-l { font-size: 13px; color: var(--pencil); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn { color: #b45309; background: #fef3c7; border-radius: 6px; padding: 6px 10px; }

.week button .d { white-space: nowrap; }
.week button.today .d { background: var(--mark); border-radius: 4px; padding: 0 4px; }
.nlist .grp { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--desk, #f3f4f6); border-radius: 6px; padding: 5px 8px; border-bottom: 0; }
.nlist .grp small { font-weight: 400; color: var(--pencil); }
.nlist .fold-head { width: 100%; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--desk, #f3f4f6); border-radius: 6px; padding: 7px 8px; margin-top: 6px; box-shadow: 0 -6px 8px -6px rgba(0,0,0,.12); }
.week button .w { font-size: 10px; white-space: nowrap; }
.week button .d { font-size: 13px; }
.msg.wait.typing { color: var(--ink); }
.msg.wait.typing .txt::after { content: "▍"; color: var(--pencil); margin-left: 1px; }
.msg .sources { margin-top: 6px; font-size: 12px; color: var(--pencil); }
.msg .sources summary { cursor: pointer; }
.msg .sources ul { margin: 4px 0 0; padding-left: 16px; }
.msg .sources li { margin: 2px 0; }
.msg .sources a { color: var(--blue); text-decoration: none; }
.msg .sources a:hover { text-decoration: underline; }
.msg .sources small { color: var(--pencil); }
.nlist button.grp { width: 100%; border: 0; cursor: pointer; text-align: left; justify-content: flex-start; gap: 6px; align-items: center; }
.nlist button.grp .gn { flex: 1; }
.nlist button.grp .car { width: 12px; color: var(--pencil); font-size: 11px; }
.search-pane .sp-none { color: var(--pencil); font-size: 13px; margin: 2px 0 8px; }
.cal-head .cal-nav { display: flex; }
.cal-head .cal-title { font-weight: 600; font-size: 13px; padding: 2px 6px; border-radius: 6px; color: var(--ink); }
.cal-head .cal-title:hover { background: var(--desk); }
.week button .w { min-height: 13px; }

/* the circle and the number sit in fixed slots, so every row's circle lines up whatever its number is ("1、" or "10、") */
.ln .k { justify-content: flex-start; gap: 2px; }
.ln .k .ck { margin-left: auto; }
.ln .k .num { flex: none; width: 2.2em; min-width: 0; text-align: left; font-variant-numeric: tabular-nums; }
.ln.sub .k { justify-content: flex-end; }
.ln.sub .k .num { width: 0; }
@media (max-width: 760px) { .ln .k .num { width: 2em; } }

/* assistant column: draggable width, can be hidden entirely (desktop only) */
body:not(.mobile) .assist { position: relative; }
body:not(.mobile) .assist-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
body:not(.mobile) .assist-grip:hover, body.resizing .assist-grip { background: linear-gradient(90deg, transparent 3px, var(--blue, #3b6ef5) 3px, var(--blue, #3b6ef5) 5px, transparent 5px); }
body.resizing { cursor: col-resize; user-select: none; }
body:not(.mobile) .assist-hide { position: absolute; top: 8px; right: 8px; z-index: 6; border: 0; background: none; color: var(--pencil); font-size: 20px; line-height: 1; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
body:not(.mobile) .assist-hide:hover { background: var(--desk); color: var(--ink); }
body.assist-off { --assist-w: 0px; }
body.assist-off .assist { display: none; }
body.assist-off .assist-grip { display: none; }
.assist-show { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 15; border: 1px solid var(--rule); border-right: 0; background: var(--ink); color: #fff; writing-mode: vertical-rl; letter-spacing: .2em; padding: 14px 6px; border-radius: 8px 0 0 8px; cursor: pointer; font-size: 13px; }
.assist-show:hover { padding-right: 9px; }
body.mobile .assist-show, body.mobile .assist-grip, body.mobile .assist-hide { display: none !important; }
/* the chat box: icon buttons, a taller text area so the hint is not cut off */
.chat-in { align-items: flex-end; }
.chat-in .btn.ic { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; flex: none; }
.chat-in .btn.ic.mic.rec { background: #E5484D; color: #fff; border-color: #E5484D; animation: micpulse 1.2s ease-in-out infinite; }
.chat-in .btn.ic.mic.busy { opacity: .6; }
@keyframes micpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,72,77,.45); } 50% { box-shadow: 0 0 0 7px rgba(229,72,77,0); } }
.chat-in textarea { min-height: 64px; line-height: 1.45; }
.chat-in textarea::placeholder { font-size: 13px; }
body:not(.mobile) .mic-live { position: fixed; z-index: 40; right: 16px; bottom: 96px; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 0 0 1.5px #9A92F5, 0 8px 28px rgba(31,42,55,.18); display: flex; align-items: center; gap: 10px; font-size: 13px; }
body:not(.mobile) .mic-live .voice-bars { height: 20px; }
body:not(.mobile) .mic-live[hidden] { display: none; }
@media (max-width: 760px) { .chat-in .btn.ic { width: 38px; height: 38px; } .chat-in .btn.ic.mic.kb { background: var(--ink); color: #fff; } }
.week button { justify-content: center; min-height: 28px; }
.week button.today .d { padding: 1px 6px; }

/* desktop chat box: the text gets the whole width on top (so the hint is never cut), the buttons sit in a row under it */
body:not(.mobile) .chat-in { display: grid; grid-template-columns: auto auto 1fr auto; grid-template-areas: "text text text text" "img mic . send"; gap: 8px; align-items: center; }
body:not(.mobile) .chat-in #cin { grid-area: text; min-height: 72px; }
body:not(.mobile) .chat-in #imgBtn { grid-area: img; }
body:not(.mobile) .chat-in #micBtn { grid-area: mic; }
body:not(.mobile) .chat-in #sendBtn, body:not(.mobile) .chat-in #stopBtn { grid-area: send; justify-self: end; }
body:not(.mobile) .chat-in #holdBtn { display: none; }
body:not(.mobile) .week { max-width: 560px; }
body:not(.mobile) .week button .d { font-size: 13px; white-space: nowrap; }
.msgs .older { align-self: center; font-size: 12px; color: var(--pencil); padding: 2px 0 6px; }
.msgs .try-lead { align-self: flex-start; font-size: 12px; color: var(--pencil); margin-top: 6px; }
.msgs .try-tail { margin-top: 0; }
