/* Artifact detail page. Uses the tokens in site/base.css, the site's components, and the
   panel, menu and drawer from space.css and resources.css. */

/* The detail page replaces the space's nav and header; the list stays in the DOM below.
   The review toolbar stays: the detail page has states of its own. */
body.on-art #nav, body.on-art main, body.on-art .skip { display: none; }
/* signed out on an artifact's address: the sign-in page's nav comes back */
body.on-art.signed-out #nav { display: block; }
.ad { display: flex; flex-direction: column; min-height: 100vh; }
/* the screen-reader-only live regions after the page would otherwise add a pixel of scroll */
body.on-art > .sr { top: 0; }

/* ------------------------------------------------------------ the bar */
.ad-bar { position: sticky; z-index: 50; top: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 64px; padding: 0 16px 0 12px; background: rgba(243, 244, 248, .86); -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px); box-shadow: inset 0 -1px 0 var(--line); }
.ad-back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink-2); transition: background .15s, color .15s; }
.ad-back:hover { background: var(--surface-3); color: var(--ink); }
.ad-back .ic { width: 18px; height: 18px; }
.ad-id { display: flex; align-items: center; gap: 12px; min-width: 0; padding-left: 14px; box-shadow: inset 1px 0 0 var(--line); }
.ad-id > .tile { width: 30px; height: 30px; border-radius: 9px; }
.ad-id > .tile svg { width: 17px; height: 17px; }
.ad-t { display: grid; gap: 1px; min-width: 0; }
.ad-name { display: flex; min-width: 0; font: 550 17px/1.3 var(--head); letter-spacing: -.02em; }
/* the name is the rename control: it shows an edge on hover, and turns into a field on click */
.ad-name-btn { max-width: 100%; margin-left: -6px; padding: 1px 6px; overflow: hidden; border-radius: 7px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: text; transition: box-shadow .15s; }
.ad-name-btn:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.ad-name-in { field-sizing: content; min-width: 8ch; max-width: min(560px, 48vw); margin-left: -6px; padding: 1px 6px; border: 0; border-radius: 7px; outline: 0; background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue); font: inherit; letter-spacing: inherit; }
.ad-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-3); white-space: nowrap; }
.ad-in { flex: none; }
.ad-ed, .ad-share-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ad-ed .by-agent { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; }
.ad-tools { display: flex; align-items: center; gap: 8px; }
.ad-people { display: flex; padding: 3px; border-radius: 999px; transition: background .15s; }
.ad-people:hover, .ad-people[aria-expanded="true"] { background: var(--surface-3); }
.ad-people .av { --s: 28px; font-size: 11px; box-shadow: 0 0 0 2px #f3f4f8; }
.ad-people .av.more { --c: #dfe2ec; color: var(--ink-2); font-size: 10.5px; }
.ad-share-btn.a-btn { height: 36px; margin-left: 4px; padding: 0 18px; border-radius: 999px; }
.ad-more.icon-btn { width: 36px; height: 36px; border-radius: 10px; color: var(--ink-2); }
.ad-more[aria-expanded="true"] { background: var(--surface-3); color: var(--ink); }

/* the more-actions menu: same as a list row's, with the export format and a rule above Delete */
#ad-menu { width: 200px; }
#ad-menu button { display: flex; align-items: center; }
#ad-menu .danger { margin-top: 0; }
.mi-hint { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.menu-sep { display: block; height: 1px; margin: 5px 6px; background: var(--line); }

/* ------------------------------------------------------------ the artifact, full page */
/* The artifact takes the whole page under the bar, edge to edge: no frame, margin or shadow.
   Tall ones (documents, sheets, PDFs) scroll with the page; the bar stays on top. */
.ad-stage { flex: 1; display: flex; flex-direction: column; min-height: calc(100vh - 64px); background: #fff; }
.ad-stage > * { flex: 1; }
.ad-stage > .operation-result { flex: none; margin: 12px 16px 0; }
.ad-document-original { white-space: pre-wrap; overflow-wrap: anywhere; }

/* app: the site's small app at full size, under its own nav */
.ad-app { display: flex; flex-direction: column; align-items: center; background: #fff; }
.ad-app-nav { align-self: stretch; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 var(--gut); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.ad-app-nav .ap-brand { font-size: 15px; }
.ad-app-in.ap { --z: 1.3; zoom: var(--z); width: 420px; max-width: calc(100% - 40px); margin: auto 0; padding: 40px 0 64px; background: none; }

/* html: the site's page, its cover running edge to edge */
.ad-html.pg { padding: 0 0 72px; font-size: 14px; }
.ad-html .pg-cover { height: min(46vh, 420px); margin: 0; border-radius: 0; }
.ad-html .pg-cover-in { left: max(var(--gut), (100% - 960px) / 2); right: auto; max-width: 560px; bottom: 44px; gap: 10px; }
.ad-html .pg-chip { font-size: 12px; }
.ad-html .pg-h { font-size: clamp(40px, 5vw, 64px); }
.ad-html .pg-cover-in p { font-size: 16px; }
.ad-html-in { width: min(960px, 100% - var(--gut) * 2); margin: 0 auto; }
.ad-html .pg-stats, .ad-html .pg-sec { margin-inline: 0; }
.ad-html .pg-stats { gap: 14px; margin-top: 32px; }
.ad-html .pg-stats div { padding: 16px 18px; }
.ad-html .pg-stats b { font-size: 30px; }
.ad-html .pg-stats small { font-size: 13px; }
.ad-html .pg-sec { margin-top: 36px; }
.ad-html .pg-sec h4 { font-size: 13px; }
.ad-html .pg-bars { height: 160px; gap: 10px; }
.ad-html .pg-tl li { grid-template-columns: 64px 1fr; font-size: 14.5px; }

/* document: white page, one readable column */
.ad-doc { background: #fff; }
.ad-page { width: min(720px, 100% - 48px); margin: 0 auto; padding: 72px 0 120px; font-size: 18px; line-height: 1.7; }
.ad-kick { margin-bottom: 14px; font: 600 12px/1.4 var(--sans); color: var(--ink-3); }
.ad-doc-h { font: 520 44px/1.1 var(--doc); letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
.ad-page h3, .ad-pg h3 { margin: 34px 0 8px; font: 600 19px/1.3 var(--head); letter-spacing: -.02em; color: var(--ink); }
.ad-page p + p { margin-top: 14px; }

/* pdf: a viewer, pages one under another on grey */
.ad-pdf { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 32px 16px 96px; background: var(--paper-2); }
.ad-pg { position: relative; width: min(760px, 100%); aspect-ratio: 1 / 1.414; padding: 72px 80px; background: #fff; box-shadow: 0 1px 3px rgba(12, 20, 64, .12); font-size: 15px; }
.ad-pg h3:first-child { margin-top: 0; }
.ad-pg.cover { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; background: var(--g); color: #fff; }
.ad-pg.cover .ad-kick { margin: 0; color: rgba(255, 255, 255, .8); }
.ad-pg.cover h2 { font: 500 clamp(36px, 6vw, 60px)/.95 var(--head); letter-spacing: -.045em; }
.ad-pg .pn { position: absolute; left: 0; right: 0; bottom: 22px; font: 600 11px var(--sans); text-align: center; color: var(--ink-3); }
.ad-pg.cover .pn { color: rgba(255, 255, 255, .7); }
.ad-pdf-more { font-size: 12.5px; color: var(--ink-3); }

/* image and svg: the picture fitted to the page, its size under it */
.ad-media { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; margin: 0; padding: 28px; background: #e9ebf1; }
.ad-media > img { max-width: 100%; max-height: calc(100vh - 64px - 100px); object-fit: contain; }
.ad-media figcaption { font-size: 12.5px; color: var(--ink-3); }
.ad-checker { background: repeating-conic-gradient(#fff 0 25%, #eef0f5 0 50%) 0 0 / 24px 24px; }
.ad-checker > img { width: min(40vh, 60%); }

/* video: the frame fills the page, the controls along the bottom */
.ad-vid.vid { gap: 0; padding: 0; background: #070a1d; }
.ad-vid .vid-frame { flex: 1; min-height: 360px; border-radius: 0; }
.ad-vid .vid-cap { left: var(--gut); bottom: 36px; font-size: clamp(32px, 5vw, 64px); }
.ad-vid .vid-mark { left: var(--gut); top: 24px; font-size: 13px; }
.ad-vid .vid-ctl { gap: 14px; height: 56px; padding: 0 var(--gut); font-size: 13px; color: rgba(255, 255, 255, .78); }
.ad-vid .vid-ctl .ic { width: 16px; height: 16px; }
.ad-vid .vid-bar { background: rgba(255, 255, 255, .18); }

/* audio: the player in the middle of the page, on the type's colour */
.ad-audio { display: grid; place-items: center; padding: 40px var(--gut); background: color-mix(in srgb, var(--c) 6%, white); }
.ad-au-in { width: min(820px, 100%); display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 28px 22px; }
.ad-play { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--c); color: #fff; box-shadow: 0 10px 24px -12px var(--c); transition: transform .2s var(--spring); }
.ad-play:active { transform: scale(.94); }
.ad-play .ic { width: 28px; height: 28px; margin-left: 3px; }
.ad-au-t { display: grid; gap: 2px; min-width: 0; }
.ad-au-t b { font: 550 28px/1.2 var(--head); letter-spacing: -.025em; }
.ad-au-t span { font-size: 13.5px; color: var(--ink-3); }
.ad-wave { grid-column: 1 / -1; display: flex; align-items: center; gap: 3px; height: 120px; }
.ad-wave i { flex: 1; height: calc(var(--v) * 100%); border-radius: 2px; background: color-mix(in srgb, var(--c) 30%, white); }
.ad-au-time { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: -14px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* spreadsheet: the grid runs to the page's edges */
.ad-grid { overflow: auto; background: #fff; }
.ad-sheet { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.ad-sheet th { position: sticky; top: 0; height: 28px; padding: 0 8px; border: 1px solid var(--line); background: #f5f6f9; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.ad-sheet tbody th { position: static; width: 48px; }
.ad-sheet td { height: 32px; padding: 0 10px; border: 1px solid var(--line); white-space: nowrap; }
.ad-sheet tr > :first-child { border-left: 0; }
.ad-sheet tr > :last-child { border-right: 0; }
.ad-sheet thead th { border-top: 0; }
.ad-sheet .hd td { font-weight: 650; }
.ad-sheet td.sel { box-shadow: inset 0 0 0 2px var(--blue); }

/* notebook: white page, cells in one column */
.ad-nb { background: #fff; }
.ad-nb-in { width: min(900px, 100% - 48px); margin: 0 auto; display: grid; gap: 16px; padding: 48px 0 96px; }
.ad-cell.md h2 { font: 550 34px/1.15 var(--head); letter-spacing: -.03em; }
.ad-cell.md p { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.ad-cell:not(.md) { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
.ad-cn, .ad-nb pre, .ad-out code, .ad-lines, .ad-code-id { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; }
.ad-cn { padding-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.ad-nb pre { margin: 0; padding: 12px 14px; overflow-x: auto; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; line-height: 1.6; }
.ad-out { padding-left: 48px; font-size: 13.5px; color: var(--ink-2); }
.ad-out .pg-bars { height: 160px; gap: 10px; }
.ad-out p { margin-top: 10px; }
.ad-out b { color: var(--ink); }
.k { color: #7a3fc4; }
.s { color: #2f7d4a; }

/* code: an editor, the gutter down the left edge */
.ad-code { display: flex; flex-direction: column; background: #fff; }
.ad-code-h { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #f7f8fb; font-size: 13px; }
.ad-code-h b { font-weight: 650; }
.ad-code-h span { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.ad-lines { flex: 1; counter-reset: ln; overflow-x: auto; padding: 14px 0 40px; font-size: 13.5px; line-height: 1.8; background: linear-gradient(90deg, #f7f8fb 64px, #fff 0); }
.ad-lines li { counter-increment: ln; padding-right: 20px; white-space: pre; }
.ad-lines li::before { content: counter(ln); display: inline-block; width: 64px; margin-right: 20px; padding-right: 16px; text-align: right; color: var(--ink-3); user-select: none; }

/* 文件产物的原件下载页 */
.ad-file { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.ad-file-in { display: grid; justify-items: center; gap: 6px; max-width: 460px; text-align: center; }
.tile.lg { width: 72px; height: 72px; border-radius: 20px; }
.tile.lg svg { width: 36px; height: 36px; }
.ad-file h2 { margin-top: 18px; font: 550 26px/1.2 var(--head); letter-spacing: -.025em; overflow-wrap: anywhere; }
.ad-file p { font-size: 14px; color: var(--ink-2); }
.ad-file .a-btn { margin-top: 18px; }
.ad-file small { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.ad-down, .ad-wait { display: grid; place-items: center; background: var(--paper); }
/* page states: opening, didn't load, no access, not found */
.ad-app-frame{width:100%;height:calc(100vh - 72px);border:0;background:#fff}
.ad-app-frame:not([hidden]){display:block}
.ad-stage:has(> .ad-app-frame-preparing),[data-public-content]:has(> .ad-app-frame-preparing){position:relative;overflow:clip}
.ad-app-frame-preparing{position:absolute;top:0;left:0;visibility:hidden;pointer-events:none}
.ad-connector-notice:not([hidden]){padding:.6rem 1rem;background:#fff4d7;color:#523a13;font-size:.875rem;border-bottom:1px solid #e7cf9d}
.ad-connector-notice:not([hidden])+.ad-app-frame{height:calc(100vh - 112px)}
.ad-wait .tile.md { margin-bottom: 10px; }
.ad-draft-command code { overflow-wrap: anywhere; user-select: all; }
.ad-wait-l { display: inline-flex; align-items: center; gap: 9px; font-weight: 560; }
/* opened from outside its space: the logo where Back would be, and the name can't be edited */
.ad-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; transition: background .15s; }
button.ad-logo:hover { background: var(--surface-3); }
.ad-me { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.ad-me .av { --s: 28px; font-size: 12px; }
.ad-name-ro { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* signed in but not a member: the bar has only the brand */
.ad-bar-brand { grid-template-columns: auto; padding-left: 20px; }
.ad-bar-brand:has(.ad-tools) { grid-template-columns: 1fr auto; }

/* 公开应用使用整页布局，加载中的 iframe 与就绪后的正文共用同一可用区域。 */
.ad:has(> .ad-public-app) { min-height: 0; }
.ad-public-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: #fff; }
.ad-public-app > .ad-bar { flex: none; }
.ad-public-app > [data-public-files]:not(:empty) { flex: none; padding: 8px 16px; }
.ad-public-app > [data-public-content] { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: auto; }
.ad-public-opening { display: flex; flex: 1; min-height: 0; }
.ad-public-opening > .ad-wait { flex: 1; }
.ad-public-direct-preview { flex: 1; min-height: 0; height: 100%; width: 100%; overflow: hidden; }
.ad-public-app [data-public-content] > .ad-app-frame { flex: 1; min-height: 0; height: 100%; }
.ad-public-app [data-public-content] > p[role="status"] { margin: 16px; }

/* the bar with nothing known but the space */
.ad-id > .sw { width: 28px; height: 28px; border-radius: 8px; background: var(--g, transparent); }
.ad-id > .sw:has(> img) { position: relative; box-shadow: none; }
.ad-id > .sw:has(> img)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--sw-shadow); }
.ad-space { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

/* ------------------------------------------------------------ details drawer (#rs-dw) */
.tile.md { width: 44px; height: 44px; border-radius: 12px; }
.tile.md svg { width: 22px; height: 22px; }
.ad-st { display: inline-flex; align-items: center; gap: 9px; font-weight: 560; }
.ad-dd-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.ad-ppl { display: grid; gap: 7px; }
.ad-ppl li { display: flex; align-items: center; gap: 8px; }
.ad-dd-type { display: inline-flex; align-items: center; gap: 8px; }
.ad-code-id { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }

/* ------------------------------------------------------------ share */
.ad-share { position: fixed; z-index: 92; width: 440px; padding: 16px 16px 14px; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px -20px rgba(12, 20, 64, .45), 0 0 0 1px var(--line); animation: grow .22s var(--ease); }
.ad-sh-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px -6px 12px 0; }
.ad-sh-h h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 17px/1.3 var(--head); letter-spacing: -.02em; }
.ad-sh-l { margin: 16px 2px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.ad-sh-l span { margin-left: 4px; font-weight: 500; }


.ad-sh-inv { display: flex; align-items: flex-start; gap: 8px; }
.ad-sh-field { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 40px; padding: 5px 5px 5px 6px; border-radius: 10px; background: var(--surface-2); cursor: text; }
.ad-share [data-live-share-form] .ad-sh-field:has(:focus-visible) { outline: none; }
.ad-share [data-live-share-form] .ad-sh-field input { border-radius: 6px; }
.ad-sh-field:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue); }
.ad-sh-field input { flex: 1; min-width: 110px; height: 28px; padding: 0 6px; border: 0; outline: 0; background: none; font-size: 13.5px; }
.ad-sh-field input::placeholder { color: var(--ink-3); }
.ad-sh-field .ad-sh-perm { margin-left: auto; }
.ad-sh-inv > .a-btn { height: 40px; }
.ad-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 3px 0 4px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; font-weight: 560; white-space: nowrap; animation: grow .18s var(--ease); }
.ad-chip .av { --s: 20px; font-size: 9.5px; }
.ad-chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--ink-3); }
.ad-chip button:hover { background: var(--surface-3); color: var(--ink); }
.ad-chip button .ic { width: 12px; height: 12px; }


.ad-sh-sug { position: absolute; z-index: 3; left: 16px; right: 16px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 6px 6px; border-radius: 12px; background: #fff; box-shadow: 0 16px 40px -16px rgba(12, 20, 64, .4), 0 0 0 1px var(--line); }
.ad-sug { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.ad-sug:not(.has):hover, .ad-sug[aria-selected="true"] { background: var(--surface-2); }
.ad-sug.has { cursor: default; }
.ad-sug.has > :not(.ad-sug-has) { opacity: .5; }
.ad-sug .av, .ad-sug-mail { --s: 30px; }
.ad-sug-mail { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); }
.ad-sug-t, .ad-sh-n, .ad-sh-rt { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.3; }
.ad-sug-t b, .ad-sh-n b, .ad-sh-rt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.ad-sug-t small, .ad-sh-n small, .ad-sh-rt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-3); }
.ad-sug mark { padding: 1px 0; border-radius: 3px; background: #fbe9b9; color: inherit; }
.ad-sug-has { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ad-sug-wait { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
.ad-sug-wait .spin { flex: none; }
.ad-sug-none { padding: 12px 10px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }



.ad-sh-list { --ft: 0px; --fb: 0px; display: grid; max-height: clamp(150px, 100vh - 520px, 226px); overflow-y: auto; margin: 0 -14px 0 -4px; padding: 0 4px; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 var(--ft), #000 calc(100% - var(--fb)), transparent); mask-image: linear-gradient(transparent, #000 var(--ft), #000 calc(100% - var(--fb)), transparent); }
.ad-sh-list.fade-t { --ft: 18px; }
.ad-sh-list.fade-b { --fb: 30px; }
.ad-sh-list li { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 4px 0 4px 2px; }
.ad-sh-list .av { --s: 30px; }
.ad-sh-r { padding-right: 9px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

.ad-sh-perm { display: inline-flex; flex: none; align-items: center; gap: 3px; height: 28px; padding: 0 5px 0 9px; border-radius: 8px; font-size: 13px; font-weight: 560; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.ad-sh-perm:hover, .ad-sh-perm[aria-expanded="true"] { background: var(--surface-3); color: var(--ink); }
.ad-sh-perm .ic { width: 14px; height: 14px; }
.ad-sh-perm:disabled { opacity: .45; cursor: default; background: none; color: var(--ink-2); }


.ad-sh-set { margin-top: 8px; padding-top: 2px; border-top: 1px solid var(--line); }
.ad-sh-set .ad-sh-l { margin-top: 12px; }
.ad-sh-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 3px 0 3px 2px; }
.ad-sh-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); }
.ad-sh-ic.on { background: color-mix(in srgb, var(--blue) 12%, white); color: var(--blue); }
.ad-sh-ic .ic { width: 16px; height: 16px; }
.ad-sh-row:has(.ad-sh-perm:disabled) .ad-sh-rt b { color: var(--ink-3); }

.ad-sh-ro .ad-sh-rt small { white-space: normal; }
.ad-sh-note { margin: 4px 2px 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }

.ad-sh-opt { cursor: pointer; }
.ad-check { flex: none; width: 18px; height: 18px; margin: 0 5px 0 0; border-radius: 5px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); -webkit-appearance: none; appearance: none; cursor: pointer; transition: background-color .15s, box-shadow .15s; }
.ad-sh-opt:hover .ad-check:not(:checked) { box-shadow: inset 0 0 0 1.5px rgba(12, 17, 48, .32); }
.ad-check:checked { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; box-shadow: none; }
.ad-check:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }


.artifact-menu.ad-pm { position: absolute; z-index: 4; width: 256px; }
.ad-pm [role="menuitemradio"] { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 10px 6px 11px; }
.ad-pm [role="menuitemradio"] > span { flex: 1; display: grid; gap: 1px; line-height: 1.3; }
.ad-pm b { font-size: 13px; font-weight: 600; }
.ad-pm small { font-size: 11.5px; font-weight: 450; color: var(--ink-3); }
.ad-pm .ic { width: 15px; height: 15px; color: var(--blue); visibility: hidden; }
.ad-pm [aria-checked="true"] .ic { visibility: visible; }
.artifact-menu.ad-pm button.danger { margin-top: 0; }

.ad-sh-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.ad-sh-f .a-btn .ic { width: 13px; height: 13px; }
.ad-sh-f .a-btn.done { background: var(--ok); box-shadow: none; color: #fff; }


.ad-invite-chips { display: contents; }
.ad-share [data-live-share-form] .ad-chip { max-width: 100%; min-width: 0; }
.ad-share [data-live-share-form] .ad-chip > span:not(.av):not(.ad-sug-mail) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ad-share [data-live-share-form] .ad-chip > button { flex: none; }
.ad-invite-chips.is-overflowing { display: flex; flex: 1 1 100%; min-width: 0; max-height: clamp(56px, calc(100dvh - 600px), 112px); flex-wrap: wrap; align-content: flex-start; gap: 5px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.ad-share:has(.ad-invite-chips.is-overflowing) .ad-sh-f { position: sticky; bottom: -14px; z-index: 2; background: #fff; }

.ad-invite-status { margin: 5px 0 0; font-size: 12px; color: var(--ink-3); }
.ad-share-status { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.ad-share-status:empty { display: none; }
.ad-share-status[data-state="error"] { background: var(--error-surface); color: var(--error-text); }
.ad-share-copy-fallback { width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.av.person-avatar { --c: #e2e5eb; }
.person-avatar { position: relative; overflow: hidden; color: var(--ink); }
.person-avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-avatar > img[hidden] { display: none; }
.live-resource-return { padding: 14px 20px 0; }
.ad-check:disabled { opacity: .5; cursor: default; }
.ad-chip .ad-sug-mail { width: 20px; height: 20px; }
@media (forced-colors: active) {
  .ad-check { appearance: auto; background: none; box-shadow: none; }
  .ad-check:checked { background: none; }
}
@media (max-height: 760px) { .ad-share { max-height: calc(100dvh - 84px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; } }
/* ------------------------------------------------------------ delete */
.ad-del { width: min(420px, 100% - 32px); padding: 22px 22px 18px; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 30px 70px -20px rgba(6, 11, 41, .5); }
.ad-del[open] { animation: grow .2s var(--ease); }
.ad-del::backdrop { background: rgba(6, 11, 41, .32); }
.ad-del h2 { font: 550 20px/1.25 var(--head); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ad-del p { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.ad-del-a { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.a-btn.ad-danger { background: var(--error-text); }

@media (max-width: 760px), (max-height: 680px) {
  .ad-share { max-height: calc(100dvh - 84px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
}

/* ------------------------------------------------------------ narrower screens */
@media (max-width: 760px) {
  .ad-bar { gap: 8px; height: 60px; padding: 0 10px 0 6px; }
  .ad-id { gap: 10px; padding-left: 10px; }
  .ad-id > .tile { width: 26px; height: 26px; border-radius: 8px; }
  .ad-id > .tile svg { width: 15px; height: 15px; }
  .ad-name { font-size: 16px; }
  .ad-in, .ad-meta > span[aria-hidden], .ad-people { display: none; }
  .ad-share-btn.a-btn { margin-left: 0; padding: 0 14px; }
  .ad-stage { min-height: calc(100vh - 60px); }
  .ad-app-in.ap { --z: 1; padding-top: 28px; }
  .ad-html .pg-stats { grid-template-columns: 1fr; }
  .ad-page { padding: 40px 0 72px; font-size: 17px; }
  .ad-doc-h { font-size: 32px; }
  .ad-pdf { padding: 16px 10px 72px; }
  .ad-pg { padding: 32px 28px; aspect-ratio: auto; min-height: 420px; }
  .ad-nb-in { padding: 28px 0 72px; }
  .ad-cell:not(.md) { grid-template-columns: 1fr; }
  .ad-cn { padding: 0 0 4px; }
  .ad-out { padding-left: 0; }
  .ad-au-t b { font-size: 22px; }
  .ad-share { left: 10px !important; right: 10px; width: auto; }
  .ad-share :is(.a-btn, .ad-sh-perm, .icon-btn), .ad-del-a .a-btn, .ad-share-btn.a-btn, .ad-more.icon-btn { min-height: var(--touch-target); }
  .ad-share .icon-btn, .ad-more.icon-btn { min-width: var(--touch-target); }
}
.ad-workflows { margin: 0 24px 32px; padding: 16px 18px; border-radius: 12px; background: var(--surface-solid, #fbfcff); box-shadow: inset 0 0 0 1px var(--line, rgba(12, 17, 48, .09)); }
.ad-manage-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px;
  color: white; background: linear-gradient(148deg, #26436d, #122748); transform: rotate(-7deg); }
.ad-manage-icon .ic { width: 20px; height: 20px; transform: rotate(7deg); }
.ad-manage-note { color: var(--ink-muted); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.ad-manage-card { display: grid; gap: 10px; padding: 16px; margin: 0 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.ad-manage-card h3 { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.ad-manage-card header, .ad-manage-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ad-manage-card header { justify-content: space-between; }
.ad-manage-tag { border-radius: 6px; padding: 2px 7px; background: var(--surface-3); color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.ad-manage-tag[data-tone="on"] { background: #e5efff; color: #154b9e; }
.ad-manage-state { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.ad-manage-facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 8px; font-size: 13px; }
.ad-manage-facts dt { color: var(--ink-muted); }
.ad-manage-facts dd { overflow-wrap: anywhere; }
.ad-manage-choice { display: grid; gap: 8px; }
.ad-manage-choice select { width: 100%; min-height: 36px; padding: 6px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-ctl); background: white; }
.ad-manage-crumb { margin-bottom: 14px; }
.ad-manage-card :is(.a-btn,select):disabled { opacity: .48; }
.ad-workflow-editor label, .ad-workflow-triggers { display: grid; gap: 6px; }
.ad-workflow-triggers[hidden] { display: none; }
.ad-workflow-triggers legend { font-weight: 600; margin-bottom: 6px; }
.ad-workflow-triggers label:has(input[type="checkbox"]) { display: flex; align-items: center; }
.ad-workflow-editor :is(input:not([type="checkbox"]),textarea,select) { box-sizing: border-box; width: 100%; min-height: 36px;
  padding: 6px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.ad-workflow-editor textarea { resize: vertical; }
@media (max-width: 720px) {
  .ad-manage-card-actions .a-btn, .ad-manage-choice select, .ad-manage-crumb { min-height: var(--touch-target); }
}

.ad-pdf-preview { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px var(--gut); min-width: 0; background: var(--surface-2); }
.ad-pdf-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.ad-pdf-preview canvas { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }

.ad-xlsx-preview { min-width: 0; padding: 16px var(--gut); }
.ad-xlsx-preview [role="tablist"] { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.ad-xlsx-preview [role="tab"] { padding: 6px 12px; border-radius: var(--r-ctl); color: var(--ink-2); background: var(--surface-2); }
.ad-xlsx-preview [role="tab"][aria-selected="true"] { color: var(--paper); background: var(--ink); font-weight: 600; }
.ad-xlsx-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.ad-xlsx-scroll { overflow: auto; max-height: 65vh; }
.ad-xlsx-scroll table { border-collapse: collapse; margin-top: 8px; }
.ad-xlsx-scroll caption { text-align: left; font-weight: 600; }
.ad-xlsx-scroll td { border: 1px solid var(--line); padding: 4px 8px; min-width: 88px; max-width: 320px; overflow-wrap: anywhere; }

/* 纯 DOM 查看器共享正文宽度、工具栏及内容节奏。 */
.ad-viewer-shell { box-sizing: border-box; width: min(100%, 1040px); min-width: 0; margin: 0 auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; line-height: 1.6; }
.ad-viewer-toolbar, .ad-viewer-shell > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-viewer-shell .a-btn, .ad-xlsx-controls .a-btn { flex: 0 0 auto; width: auto; align-self: flex-start; }
.ad-viewer-shell table { width: 100%; border-collapse: collapse; background: var(--surface, #fff); border-radius: 10px; overflow: hidden; }
.ad-viewer-shell th, .ad-viewer-shell td { padding: 8px 12px; border-bottom: 1px solid rgba(15,23,42,.08); text-align: left; vertical-align: top; }
.ad-viewer-shell th { font-weight: 600; background: var(--surface-2, #f8fafc); }
.ad-viewer-shell pre { max-width: 100%; overflow: auto; padding: 14px 16px; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; background: var(--surface-2, #f8fafc); white-space: pre; }
.ad-viewer-shell code, .ad-viewer-shell textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ad-viewer-shell p, .ad-viewer-shell h1, .ad-viewer-shell h2, .ad-viewer-shell h3 { overflow-wrap: anywhere; }
.ad-viewer-shell blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--line, #cbd5e1); }
.ad-viewer-shell input[type="text"], .ad-viewer-shell textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line, #cbd5e1); border-radius: 10px; color: var(--ink, #0f172a); background: var(--surface, #fff); }
.ad-viewer-shell input[aria-label="Document title"] { font: 600 20px/1.4 var(--head, sans-serif); }
.ad-document-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ad-document-columns > * { min-width: 0; }
.ad-document-columns textarea { min-height: 380px; resize: vertical; }
.ad-document-columns .ad-viewer-shell { padding: 0 4px; }
@media (max-width: 720px) {
  .ad-viewer-shell { padding: 16px 12px; }
  .ad-document-columns { grid-template-columns: minmax(0, 1fr); }
  .ad-viewer-shell th, .ad-viewer-shell td { padding: 8px; }
}

.ad-file-download { min-width: 0; }
.ad-download-icon { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 24px; background: var(--surface-2); color: var(--ink-2); }
.ad-download-icon svg { width: 48px; height: 48px; }
.ad-file-download .ad-file-in { width: 100%; }
.ad-file-download h2 { max-width: 100%; }

/* 视频复制流程浮于现有顶栏，不在播放器上下另占一行。 */
.ad-tools:has(> .ad-public-video-copy) { position: relative; }
.ad-public-video-copy > summary { list-style: none; cursor: pointer; }
.ad-public-video-copy > summary::-webkit-details-marker { display: none; }
.ad-public-video-copy-panel { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: min(320px, calc(100vw - 32px)); max-height: calc(100dvh - 96px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #fff); box-shadow: 0 8px 28px #14233b24; }
@media (max-width: 480px) {
  .ad-tools:has(> .ad-public-video-copy) { position: static; }
  .ad-public-video-copy-panel { right: 16px; }
  .ad-public-app .ad-tools { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
  .ad-public-app .ad-bar { height: auto; min-height: 64px; }
}
.ad-public-video-copy-panel form, .ad-public-video-copy-panel label { display: flex; flex-direction: column; gap: 10px; }
.ad-public-video-copy-panel [role="status"] { margin: 10px 0 0; }
.ad-public-video-copy-panel [role="status"]:empty { display: none; }

/* 整屏类处理器（PDF、演示、表格）按舞台剩余高度铺满；此前按整个视口取高，会被 64px 顶栏挤出屏幕底部。 */
.ad-stage:has(.artifact-editor-host :is(.pdf-viewer, .pptx-editor, .xlsx-editor, .mv-image-viewer:not(.mv-direct-page))) { flex: 0 0 auto; height: calc(100dvh - 64px); min-height: 0; overflow: hidden; }
.artifact-editor-host :is(.pdf-viewer, .pptx-editor, .xlsx-editor, .mv-image-viewer:not(.mv-direct-page)) { height: 100%; min-height: 0; }
@media (min-width: 701px) {
  .ad-stage:has(.artifact-editor-host .csv-editor) { flex: 0 0 auto; height: calc(100dvh - 64px); min-height: 0; overflow: hidden; }
  .artifact-editor-host .csv-editor { height: 100%; min-height: 0; }
}
@media (max-width: 700px) {
  .ad-stage:has(.artifact-editor-host :is(.pdf-viewer, .pptx-editor, .xlsx-editor, .mv-image-viewer:not(.mv-direct-page))) { height: calc(100dvh - 60px); }
}

/* 直接编辑体验：宿主右上角的保存状态提示，不占正文高度。 */
.artifact-editor-host.ed-direct { position: relative; }
.ed-host-status { position: absolute; top: 12px; right: 20px; z-index: 30; padding: 3px 10px; border-radius: 999px; background: #ffffffe0; color: #6b7080; font: 500 12px/18px var(--ed-font, system-ui, sans-serif); pointer-events: none; backdrop-filter: blur(6px); }
.ed-direct:is([data-ed-state="paused"], [data-ed-flash="true"]) .ed-host-status { background: #fff5df; color: #80510a; }
.ed-direct[data-ed-state="blocked"] .ed-host-status { background: #fff0ef; color: #a73131; }

.ed-host-corner { position: absolute; top: 10px; right: 20px; z-index: 30; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.ed-host-corner > * { pointer-events: auto; }
.ed-host-corner .ed-host-status { position: static; pointer-events: none; }
.ed-host-corner select { min-height: 28px; max-width: 220px; padding: 2px 8px; border: 1px solid #e5e8f0; border-radius: 8px; background: #fff; color: #464d68; font: 500 12px/20px var(--ed-font, system-ui, sans-serif); }
.ed-direct .ed-engine-label { display: none; }
