/* MA member web app — light theme, iPhone first. */
:root {
  --bg: #f6f7fb; --card: #fff; --line: #e3e7ef; --text: #111827; --muted: #6b7280;
  --blue: #2563eb; --blue-50: #eff6ff; --red: #dc2626; --red-50: #fef2f2; --amber: #b45309; --amber-50: #fffbeb;
  --green: #15803d; --green-50: #f0fdf4; --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; -webkit-text-size-adjust: 100%; }
body.dark { background: #000; }
a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }
[hidden] { display: none !important; }   /* B2-05: .btn { display: inline-flex } used to beat the hidden attribute */
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.warn-t { color: var(--amber); }

#view { padding: calc(var(--safe-top) + 8px) 14px calc(76px + var(--safe-bottom)); max-width: 720px; margin: 0 auto; }
.page.center { min-height: 70vh; display: flex; align-items: center; justify-content: center; flex-direction: column; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
header.top h1 { font-size: 26px; margin: 4px 0; }
h1 { font-size: 22px; } h3 { font-size: 15px; margin: 14px 0 6px; color: #374151; } h3.sec { margin-top: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 15px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
button.link, .btn.link { background: none; border: none; color: var(--blue); font: inherit; padding: 8px; cursor: pointer; }
input[type=text], input[type=search], input[type=password], select { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; }
select { width: auto; flex: 1; min-width: 0; }
.field { display: block; margin: 10px 0; } .field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.err { color: var(--red); font-size: 14px; min-height: 1em; margin: 6px 0; }
.login { width: 100%; max-width: 380px; } .login h1 { margin: 0; font-size: 28px; }

.banner { border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.banner.info { background: var(--blue-50); border: 1px solid #bfdbfe; }
.banner.warn { background: var(--amber-50); border: 1px solid #fde68a; color: #78350f; }
.banner.ok { background: var(--green-50); border: 1px solid #bbf7d0; color: #14532d; }
.banner.muted-b { background: #f3f4f6; color: var(--muted); }
.steps { margin: 6px 0; padding-left: 20px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eef2f7; color: #374151; margin-left: 6px; vertical-align: middle; }
.tag.warn { background: var(--amber-50); color: var(--amber); } .tag.bad { background: var(--red-50); color: var(--red); }

/* list */
.searchbar { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 6px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 14px; white-space: nowrap; color: #374151; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.list { margin-top: 6px; }
.item { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; color: var(--text); }
.item .title { font-weight: 600; display: block; color: var(--text); } .item .src { margin-right: 6px; }
.item .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .hit { display: block; font-size: 14px; color: #374151; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.item .hit .tag { margin: 0 6px 0 0; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; } .empty .btn { margin-top: 14px; }
.pending .row { margin-bottom: 0; }

/* detail */
.back { font-size: 17px; }
.dhead h1 { margin: 4px 0 2px; font-size: 21px; } .dhead .meta { color: var(--muted); font-size: 13px; }
.player { margin: 8px 0; display: flex; gap: 8px; align-items: center; } .player audio { flex: 1; min-width: 0; height: 40px; }
.player .rate { flex: 0 0 auto; width: 76px; }
.tabs { display: flex; gap: 4px; background: #e9edf4; padding: 3px; border-radius: 12px; margin: 10px 0; position: sticky; top: 0; z-index: 2; }
.tab { flex: 1; border: none; background: none; padding: 8px; border-radius: 10px; font: inherit; font-size: 15px; color: #374151; }
.tab.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.kind h3 { margin-top: 16px; }
.sitem { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0; }
.sitem.focus { border-color: var(--blue); box-shadow: 0 0 0 2px #bfdbfe; }
.cites { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.cite { border: 1px solid #bfdbfe; background: var(--blue-50); color: var(--blue); border-radius: 10px; font: inherit; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.seg { display: flex; gap: 8px; padding: 8px 6px; border-radius: 10px; scroll-margin: 80px; }
.seg .t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 42px; padding-top: 2px; }
.seg .ch { font-size: 12px; color: var(--muted); min-width: 28px; padding-top: 2px; }
.seg.focus { background: #fef9c3; }
.sess { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 4px; }

/* record */
.record header.top input { font-size: 18px; font-weight: 600; border-color: transparent; background: transparent; padding-left: 0; }
.tips { margin: 8px 0 0; padding-left: 20px; color: #374151; font-size: 14px; }
.bigbtn { font: inherit; font-size: 18px; border-radius: 18px; border: 1px solid var(--line); background: #fff; min-height: 64px; padding: 10px; cursor: pointer; }
.bigbtn.start { background: var(--red); color: #fff; border: none; width: 220px; height: 220px; border-radius: 50%; font-size: 22px; margin: 26px auto 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 10px 30px rgba(220, 38, 38, .25); }
.bigbtn.start .dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.bigbtn.stop { color: var(--red); } .bigbtn.flash { background: #fef3c7; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.live .timer { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.lvl { height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; margin: 6px 0 8px; }
.lvlb { height: 100%; width: 0; background: #16a34a; transition: width .15s; }
.tag.st-recording { background: var(--red-50); color: var(--red); } .tag.st-paused { background: var(--amber-50); color: var(--amber); }
.tag.st-interrupted { background: var(--red); color: #fff; } .tag.st-ending { background: #e5e7eb; }
.record[data-state=paused] .live { border-color: #fdba74; background: #fff7ed; }
.undo { position: fixed; left: 14px; right: 14px; bottom: calc(84px + var(--safe-bottom) + var(--vv-gap, 0px)); background: #111827; color: #fff; border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 40; }
.undo .link { color: #93c5fd; font-weight: 600; }

/* black anti-mis-touch page (M6) */
#black { position: fixed; inset: 0; background: #000; color: #4b5563; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#black .t { font-size: 48px; font-variant-numeric: tabular-nums; color: #6b7280; }
#black .d { width: 14px; height: 14px; border-radius: 50%; background: #22c55e; opacity: .35; margin-top: 16px; transition: opacity .15s; }
#black .d.starred { background: #facc15; opacity: 1; transform: scale(1.6); }
#black .stars { color: #a16207; min-height: 22px; margin-top: 10px; }
#black .lps { display: flex; gap: 40px; margin-top: 50px; }
#black .lp { --p: 0; width: 76px; height: 76px; border-radius: 50%; border: 2px solid #374151; background: conic-gradient(#9ca3af calc(var(--p) * 360deg), #111 0); color: #9ca3af; font-size: 26px; }
#black .hint { font-size: 13px; color: #4b5563; margin-top: 16px; text-align: center; padding: 0 20px; }
/* v0.3.6 captions on the black page: as inconspicuous as the page itself - dim grey on pure black, small, max 2 lines,
   no box / chip, slow fade only; never takes taps (pointer-events: none); drifts a few px per minute (burn-in) */
#black .bcap { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 36px); left: 22px; right: 22px; pointer-events: none; transition: transform 2s ease; }
#black .bcap-lines { font-size: 15px; line-height: 1.45; max-height: calc(2 * 1.45em); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; word-break: break-word; }
#black .bcap-line { color: #5a5a5a; animation: bcap-fade 1.2s ease; transition: color 1.2s ease; }
#black .bcap-line.partial { color: #3a3a3a; }
@keyframes bcap-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #black .bcap { transition: none; } #black .bcap-line { animation: none; transition: none; } }

/* overlays */
.ov { position: fixed; inset: 0; z-index: 60; }
.ov.resume { background: rgba(220, 38, 38, .97); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.resume-in .big { font-size: 28px; font-weight: 700; margin-bottom: 10px; } .resume-in .small { opacity: .9; margin-top: 8px; }
.resume-btn { margin-top: 28px; font: inherit; font-size: 22px; font-weight: 700; padding: 18px 36px; border-radius: 40px; border: none; background: #fff; color: var(--red); cursor: pointer; }
.link.light { color: #fecaca; display: block; margin: 18px auto 0; }
.ov.recovery { background: rgba(17, 24, 39, .45); display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.sheet h2 { margin: 0; font-size: 20px; }

/* todos / settings */
.kcol h3 { margin: 18px 0 8px; }
.kcol-toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; cursor: pointer; font: inherit; font-weight: 700; -webkit-tap-highlight-color: transparent; }
.kcol-toggle::before { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 6px 4px 2px; transition: transform .15s; flex: 0 0 auto; }
.kcol-toggle[aria-expanded=false]::before { transform: rotate(-45deg); margin: 0 6px 0 0; }
.kcol-toggle:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; border-radius: 6px; }
.kcol-list[hidden] { display: none; } .kcol-archived { margin: 16px 0 4px; text-align: center; } .todo .title { font-weight: 600; } .todo.overdue { border-color: #fecaca; background: var(--red-50); }
.row-set { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row-set:first-of-type { border-top: none; } .row-set input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 auto; }

/* chrome */
#tabbar { position: fixed; left: 0; right: 0; bottom: var(--vv-gap, 0px); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-bottom); z-index: 30; }
#tabbar a { flex: 1; text-align: center; padding: 7px 0 6px; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; }
#tabbar a .i { font-size: 20px; line-height: 1.2; } #tabbar a.on { color: var(--blue); font-weight: 600; }
#rec-pill { position: fixed; top: calc(var(--safe-top) + 6px); left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 4px 14px; border-radius: 14px; font-size: 13px; z-index: 35; font-variant-numeric: tabular-nums; cursor: pointer; }
#toast { position: fixed; left: 0; right: 0; bottom: calc(90px + var(--safe-bottom) + var(--vv-gap, 0px)); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 70; pointer-events: none; }
.toast-in { background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; pointer-events: auto; max-width: 90vw; }
.toast-in .link { color: #93c5fd; padding: 0; }
.row > input[type=text] { flex: 1; width: auto; min-width: 0; }
.cite.rt { border-style: dashed; background: #fff; }
.reclassified { margin-top: 4px; }

/* Brand mark on the login card (icon: design/icons/mw_icon.py) */
.card.login h1::before { content: ""; display: block; width: 64px; height: 64px; margin: 0 0 14px;
  border-radius: 15px; background: url(../icons/icon-192.png) center / cover; box-shadow: 0 4px 12px rgba(255, 61, 110, .25); }
/* v0.2.3 回收站 + confirm sheets + multi-object player */
.ov.confirm { background: rgba(17, 24, 39, .45); display: flex; align-items: flex-end; z-index: 70; }
.ov.confirm .sheet p { margin: 0; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.danger-o { color: var(--red); border-color: #fecaca; }
.btn:disabled { opacity: .45; cursor: default; }
.item.mitem { display: flex; align-items: center; gap: 6px; }
.item.mitem .main { flex: 1; min-width: 0; color: var(--text); }
.icon-btn { flex: 0 0 auto; border: none; background: none; font-size: 18px; min-width: 40px; min-height: 40px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.icon-btn:active { background: #f3f4f6; }
.chip.trash-chip { color: var(--muted); }
.trash .item .actions { display: flex; gap: 8px; margin-top: 8px; }
.trash .purge-in { color: var(--amber); }
.player .pl-btn { flex: 0 0 auto; min-width: 44px; }
.player input[type=range] { flex: 1; min-width: 0; }
.player .pl-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.player audio { display: none; }

/* v0.2.4: detail = host of the shared minutes renderer (css/minutes.css), viewer, versions, writable board */
.minutes-host { --mwm-sticky-top: var(--safe-top); --mwm-bar-bg: var(--bg); }
.banner.bad { background: var(--red-50); border: 1px solid #fecaca; color: #7f1d1d; }
.banner .btn.sm { margin-top: 6px; }
.tag.ok { background: var(--green-50); color: var(--green); }
.tag.auto-title { border: 1px dashed #c7cbd6; background: #fff; color: var(--muted); font-weight: 400; cursor: pointer; font-family: inherit; }
h1 .tag.auto-title { font-size: 12px; vertical-align: 4px; }
.vlist { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.vrow { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.vrow.current { border-color: #bbf7d0; background: var(--green-50); }
.vrow .vmain { flex: 1; min-width: 0; }
.ov.viewer { background: rgba(0, 0, 0, .94); color: #fff; z-index: 80; display: flex; flex-direction: column; }
.vw-top, .vw-bottom { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 8px) 12px 8px; }
.vw-bottom { padding: 8px 12px calc(var(--safe-bottom) + 12px); justify-content: space-between; }
.vw-top { justify-content: space-between; } .vw-acts { display: flex; gap: 8px; }
.vw-btn { border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; border-radius: 10px; padding: 6px 12px; font: inherit; font-size: 14px; min-height: 36px; }
.vw-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; -webkit-overflow-scrolling: touch; }
.vw-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.ov.viewer.natural .vw-stage { display: block; } .ov.viewer.natural .vw-img { max-width: none; max-height: none; }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 30px; width: 44px; height: 64px; border-radius: 10px; }
.vw-nav.prev { left: 6px; } .vw-nav.next { right: 6px; }
.vw-cap { font-size: 14px; min-width: 0; } .vw-cap .vw-t { color: #cbd5e1; margin-right: 6px; font-variant-numeric: tabular-nums; }
.vw-count { font-size: 13px; color: #cbd5e1; }
/* board */
.todo { padding: 12px; } .todo.done .title { color: var(--muted); text-decoration: line-through; }
.todo-main { cursor: pointer; } .todo-detail { color: #374151; margin-top: 2px; white-space: pre-wrap; }
.todo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.seg3 { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 2px; gap: 2px; margin-left: auto; }
.seg3-b { border: none; background: none; font: inherit; font-size: 13px; padding: 5px 9px; border-radius: 8px; color: #4b5563; min-height: 32px; cursor: pointer; }
.seg3-b.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg3-b:disabled { opacity: .5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .row2 .field { margin: 0; }
textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; resize: vertical; }
input[type=date] { font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; min-height: 44px; }
.ov.confirm .sheet { max-height: 92vh; overflow-y: auto; }
@media (min-width: 900px) { #view:has(.page.detail) { max-width: 1160px; } }

/* 打印 / 存 PDF (detail): only the minutes, as on screen */
@media print {
  html, body { background: #fff !important; }
  #tabbar, #toast, #rec-pill, #overlay, .ov, .page.detail > header.top, .player, .dhead { display: none !important; }
  #view { padding: 0 !important; max-width: none !important; }
}

/* v0.6: 我的 / 团队, share switch, team list filters, assigned cards (§7), settings link row */
.seg2 { display: flex; gap: 4px; background: #e9edf4; padding: 3px; border-radius: 12px; margin: 4px 0 10px; }
.seg2-b { flex: 1; text-align: center; padding: 7px 4px; border-radius: 10px; color: #374151; text-decoration: none; font-size: 15px; }
.seg2-b.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; color: var(--ink, #1f2433); }
.share-row { border-top: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.share-row input[type=checkbox] { width: 22px; height: 22px; }
.team-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.team-filters select, .team-filters input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 36px; }
.item.team .owner { color: #1d4ed8; }
.todo-assigned { margin: 6px 0 2px; padding: 6px 8px; background: #eef4ff; border-radius: 10px; }
.todo-assigned .tag-from { color: #1d4ed8; }
.link-row { text-decoration: none; color: inherit; }
.page.detail.team .dhead h1 { padding-right: 0; }

/* v0.3.4: 共享给团队 button in the detail top actions (iPhone: always visible next to 播放录音) */
.share-btn { color: #1d4ed8; border-color: #bfd3fb; background: #eef4ff; white-space: nowrap; }
.share-btn.on { color: #166534; border-color: #bbe5c8; background: #ecfdf3; }
.page.detail > header.top .row { flex-wrap: nowrap; gap: 6px; }
.page.detail > header.top .row .btn.sm { padding: 6px 10px; white-space: nowrap; }
.page.detail > header.top .back { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 420px) { .page.detail > header.top .wide-only { display: none; } }   /* iPhone: 「▶ 播放」 so 共享给团队 fits */

/* v0.3.5 live captions on the record page (ADR-51): last 3 lines, large text, partial lighter than final */
.cap { padding: 10px 14px 12px; }
.cap .cap-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cap-chip { font-size: 12px; padding: 2px 9px; border-radius: 10px; background: #eef2f7; color: #374151; }
.cap-chip.live { background: #e8f5ee; color: #166534; } .cap-chip.fb { background: var(--amber-50); color: var(--amber); }
.cap-chip.off { background: #f3f4f6; color: var(--muted); }
.cap-lines { font-size: 20px; line-height: 1.45; max-height: calc(3 * 1.45em + 6px); overflow-y: auto; margin-top: 6px; overscroll-behavior: contain; word-break: break-word; }
.cap-line { color: var(--text); margin: 1px 0; }
.cap-line.partial { color: #6b7280; }
.cap-line.refined { color: var(--text); }
.cap-empty { font-size: 15px; color: var(--muted); margin-top: 6px; }
.cap.hide .cap-lines, .cap.hide .cap-empty { display: none; }
