:root {
  color-scheme: light;
  --ink: #191c22;
  --muted: #606774;
  --line: #e1e3e9;
  --canvas: #f4f5f8;
  --white: #fff;
  --blue: #005ec7;
  --blue-dark: #004fad;
  --selection: #e7f0ff;
  --focus: #578dd7;
  --danger: #ac3126;
  --shadow: 0 1px 2px #15264d06, 0 12px 36px #15264d08;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(35px, 5vw, 54px); line-height: 1.16; letter-spacing: -.06em; font-weight: 700; }
h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.035em; }
h3 { font-size: 16px; line-height: 1.4; }
.muted, small { color: var(--muted); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  cursor: pointer;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
button:hover { background: #f3f5f9; }
button:disabled { opacity: .55; cursor: default; }
button[aria-busy="true"] { cursor: progress; }
button.primary { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 600; }
button.primary:hover { background: var(--blue-dark); }
button.subtle, button.flat, button.tool { border-color: transparent; background: transparent; }
button.subtle:hover, button.flat:hover, button.tool:hover { background: #eef0f5; }
button.tool { min-height: 32px; padding: 5px 8px; font-size: 12px; }
button.tool.on { background: var(--selection); color: #064da2; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
input, select, textarea {
  max-width: 100%;
  min-width: 0;
  border: 1px solid #d7dbe4;
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--white);
}
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 6px; margin: 14px 0; font-size: 13px; font-weight: 600; }
input::placeholder, textarea::placeholder { color: #697080; }
.row, .bar, .cluster { display: flex; align-items: center; gap: 10px; }
.row { justify-content: space-between; }
.cluster { flex-wrap: wrap; }
.wide { width: 100%; }
.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 690; letter-spacing: -.025em; white-space: nowrap; flex-shrink: 0; }
.brand img { display: block; width: 72px; height: auto; flex-shrink: 0; }
.ui-icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.icon-button { display: inline-flex; gap: 5px; justify-content: center; align-items: center; min-width: 38px; min-height: 38px; padding: 6px; }
button.danger-icon { color: #745458; }
button.danger-icon:hover { color: var(--danger); background: #fff0ef; }
button.danger { background: #b6342b; color: white; font-weight: 600; border-color: #b6342b; }
button.danger:hover { background: #a32b23; }
.paper-mark {
  display: inline-block;
  position: relative;
  flex: none;
  width: 1em;
  height: 1.16em;
  padding: 0;
  border-radius: .21em .35em .23em .23em;
  background: linear-gradient(150deg, #60a4fa 0%, #2666c7 76%);
  box-shadow: inset 0 0 0 1px #143f8c26;
}
.paper-mark::after {
  position: absolute;
  content: "";
  inset: 44% 23% auto;
  height: 25%;
  border-block: 1px solid #ffffffe0;
}

/* Login */
.auth {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  min-height: 100svh;
  background: var(--white);
}
.auth-form { display: grid; place-items: center; padding: 56px clamp(32px,6vw,90px); }
.auth-form form { width: 100%; max-width: 370px; }
#app:has(> .site-footer) { min-height: 100svh; display: flex; flex-direction: column; }
#app > .auth { flex: 1; min-height: 0; }
.site-footer { margin-top: auto; width: 100%; padding: 16px 18px; border-top: 1px solid var(--line); background: var(--white); color: #546071; font-size: 12px; text-align: center; }
.site-footer p { margin: 0 0 6px; }
.site-footer div, .site-footer a { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px; }
.site-footer div { gap: 6px 14px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer img { object-fit: contain; }
.auth-form .brand { margin-bottom: 29px; gap: 14px; font-size: clamp(18px,2.3vw,25px); }
.auth-form .brand img { width: 100px; }
.auth-form label { margin: 17px 0 0; }
.auth-form input { min-height: 48px; }
.auth-form form > button { width: 100%; margin-top: 9px; min-height: 46px; border-radius: 10px; }
.auth-form .error:empty { min-height: 9px; }
.auth-preview {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 22% 12%, #fff 0%, transparent 58%), radial-gradient(at 94% 88%, #a9b9ed, transparent 58%), linear-gradient(135deg,#e8effa,#d7e1ff 45%,#cbd1f7);
}
.preview-grid {
  position: absolute;
  inset: 0;
  opacity: .25;
  background: radial-gradient(#6d7ca8 1px, transparent 1px) 0 0 / 17px 17px;
  mask-image: linear-gradient(150deg, transparent 15%, #000);
}
.preview-window {
  position: absolute;
  width: min(78%,700px);
  aspect-ratio: 1.16;
  left: 48%;
  top: 49%;
  transform: translate(-50%,-50%) perspective(950px) rotateX(8deg) rotateY(-11deg) rotateZ(-9deg);
  background: #f9fbff;
  border-radius: 15px;
  border: 1px solid #ffffff;
  overflow: hidden;
  box-shadow: 3px 24px 54px #2d438439, inset 0 1px #fff;
}
.preview-toolbar { height: 13%; display: flex; align-items: center; gap: 5px; padding: 0 4%; border-bottom: 1px solid #dce3f0; }
.preview-toolbar i { width: 7px; height: 7px; border-radius: 50%; background: #b1bfd9; }
.preview-toolbar span { height: 6px; width: 22%; border-radius: 3px; margin: auto; background: #e2e9f6; }
.preview-body { display: grid; grid-template-columns: 24% 1fr; height: 87%; background: #edf2fc; }
.preview-index { padding: 13% 12%; border-right: 1px solid #dce3f0; }
.preview-index span, .preview-index i { display: block; height: 13px; border-radius: 4px; background: #dbe4f3; margin: 0 0 10px; }
.preview-index span { background: #c7d9fd; }
.preview-index i:nth-child(3) { width: 65%; }
.preview-document {
  padding: 10% 11%;
  margin: 7% 8% 0;
  border-radius: 6px 6px 0 0;
  background: white;
  box-shadow: 0 1px 9px #4d69a015;
}
.preview-title { width: 80%; height: 11px; border-radius: 2px; background: #42557c; }
.preview-rule { width: 37%; height: 5px; background: #b9c6de; margin: 11px 0 22px; }
.preview-lines { height: 31px; background: repeating-linear-gradient(#dce4f3 0 3px, transparent 3px 9px); }
.preview-lines.short { width: 80%; }
.preview-formula { font: italic clamp(14px,3.5vw,38px)/1.5 Georgia, serif; color: #2e4b89; margin: 6% 0; text-align: center; }
.preview-note {
  position: absolute;
  width: min(42%,360px);
  aspect-ratio: 1.5;
  right: max(8%,calc(50% - 345px));
  bottom: max(14%,calc(50% - 250px));
  transform: rotate(8deg);
  padding: 5% 6%;
  border: 1px solid #fff;
  border-radius: 15px;
  background: #f9fbff;
  box-shadow: 3px 15px 32px #34467f43;
}
.preview-note-heading { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: #37548e; }
.preview-chart { display: flex; height: 75%; align-items: flex-end; justify-content: space-around; gap: 8px; padding-top: 8px; border-bottom: 1px solid #bbc8e2; }
.preview-chart i { flex: 1; height: 36%; border-radius: 4px 4px 0 0; background: #a0c0f5; }
.preview-chart i:nth-child(2) { height: 63%; background: #8aaff0; }
.preview-chart i:nth-child(3) { height: 51%; }
.preview-chart i:nth-child(4) { height: 84%; background: #5985dc; }
.preview-chart i:nth-child(5) { height: 74%; background: #779be5; }

/* Report library and account management */
.top { height: 69px; border-bottom: 1px solid var(--line); background: #fff; }
.top-content { display: flex; justify-content: space-between; align-items: center; height: 100%; margin: auto; padding: 0 36px; max-width: 1400px; gap: 16px; }
.top-content > .bar { min-width: 0; gap: clamp(10px, 3vw, 39px); }
.top-content > .top-actions { gap: 9px; }
.main-nav { display: flex; gap: 5px; }
.main-nav button { border: 0; color: var(--muted); background: transparent; white-space: nowrap; }
.main-nav button.current, .main-nav button:hover { background: #f1f3f7; color: var(--ink); }
.profile { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; }
.profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.avatar { display: grid; place-items: center; flex: none; height: 31px; width: 31px; border-radius: 50%; background: #e9edf6; color: #3e4d6d; font-size: 13px; font-weight: 700; }
.top-actions button { font-size: 13px; white-space: nowrap; }
.main { width: min(100%, 1256px); margin: auto; padding: 60px 36px 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 33px; }
.page-heading p { color: var(--muted); margin-top: 10px; }
.page-heading .primary { white-space: nowrap; min-height: 43px; padding-inline: 17px; border-radius: 12px; }
.sectionbar, .accounts-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.tabs { display: flex; gap: 4px; align-items: center; overflow: auto; scrollbar-width: thin; }
.tabs button { border: 0; white-space: nowrap; font-size: 13px; background: transparent; }
.tabs button.on { background: var(--selection); color: #0b4b97; font-weight: 600; }
.segmented { background: #e9ebf1; border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button { min-height: 34px; }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px #21305215; }
.search-field { position: relative; }
.search-field input { width: 238px; padding-left: 35px; font-size: 13px; }
.search-field i { position: absolute; top: 13px; left: 13px; width: 12px; height: 12px; border: 1.5px solid #697385; border-radius: 50%; pointer-events: none; }
.search-field i::after { content: ""; position: absolute; top: 8px; left: 8px; width: 5px; border-top: 1.5px solid #697385; transform: rotate(45deg); transform-origin: left; }
.report-home { max-width: 1112px; margin-block: 0; }
body:has(.report-home) { background: #fff; min-height: 100svh; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.list-tools > button { color: var(--muted); white-space: nowrap; font-size: 13px; }
.report-month { margin-top: 24px; }
.report-month h2 { padding: 0 0 9px; border-bottom: 1px solid var(--line); color: #495364; font-size: 14px; letter-spacing: 0; }
.report-month ul { margin: 0; padding: 0; list-style: none; }
.report-row { display: grid; grid-template-columns: minmax(0,1fr) max-content 88px; align-items: center; min-height: 70px; border-bottom: 1px solid #edf0f5; gap: 13px; padding-right: 6px; }
.report-row:hover { background: #f8faff; }
.report-link { display: flex; justify-content: flex-start; align-items: center; gap: 12px; min-width: 0; background: transparent; border: 0; text-align: left; padding: 11px 8px; border-radius: 0; overflow-wrap: anywhere; }
button.report-link:hover { background: transparent; }
.report-doc { display: grid; place-items: center; width: 34px; height: 38px; flex: none; border-radius: 8px; background: #edf3fc; color: #2c64af; }
.report-detail { display: grid; gap: 2px; }
.report-detail strong { font-size: 15px; line-height: 1.35; font-weight: 640; }
.report-detail small, .report-row time { color: var(--muted); font-size: 12px; }
.report-row time { white-space: nowrap; }
.report-actions { display: flex; justify-content: flex-end; gap: 4px; }
.report-actions .icon-button { color: #5d6879; }
.report-actions .danger-icon:hover { color: var(--danger); }
.report-empty { color: var(--muted); border-top: 1px solid var(--line); padding: 18px 8px; }
.reader-empty h2 { margin: 14px 0 5px; }
.accounts-card { background: #fff; border-radius: 17px; border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.accounts-header { flex-wrap: wrap; padding: 18px 24px; margin: 0; }
.accounts-header h2 { font-size: 17px; }
.accounts-header h2 small { font-size: 13px; font-weight: 500; margin-left: 6px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 24px; border-top: 1px solid #edf0f5; overflow-wrap: anywhere; }
.account-row .bar { min-width: 0; }

/* Reading workspace */
#app:has(.roomtop) { height: 100dvh; display: flex; flex-direction: column; }
.roomtop { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; gap: 16px; min-height: 62px; background: var(--white); border-bottom: 1px solid var(--line); z-index: 4; }
.room-title, .room-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-title h3 { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.room-title button { flex: none; }
.room-divider { width: 1px; height: 19px; background: var(--line); flex: none; margin: 0 4px; }
.roomtop button { white-space: nowrap; font-size: 13px; }
.room-back { border: 0; color: var(--blue); }
.room-title .brand { font-size: 13px; gap: 5px; }
.room-title .brand img { width: 48px; }
.room-rename { color: var(--muted); }
.position { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.position::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #54816e; }
button.session-state { background: #f4f5f8; border-color: #eceef4; font-size: 12px; font-weight: 600; }
button.follow-button { color: #0b52a6; background: #edf4ff; border-color: #dfeaff; font-weight: 650; }
button.follow-button:hover { background: #e1ecff; }
.mobilebtn { display: none; }
.workspace { display: grid; flex: 1; min-height: 0; grid-template-columns: 224px minmax(0, 1fr) 302px; position: relative; }
.workspace > * { min-width: 0; overflow: auto; }
aside.left { padding: 18px 14px 25px; background: #f7f8fb; border-right: 1px solid var(--line); }
.rail-heading, .assistant-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.rail-heading h3 { padding-left: 6px; }
.side-add { border-color: transparent; background: #eaf1fc; color: #0c4fa2; font-size: 12px; min-height: 29px; padding: 4px 9px; }
.sidegroup { border-top: 1px solid var(--line); padding: 11px 0; margin-top: 7px; }
.left .sidegroup h3 { margin: 2px 6px 7px; font-size: 12px; color: var(--muted); font-weight: 650; }
.docbtn { display: flex; align-items: flex-start; text-align: left; justify-content: flex-start; border: 0; border-radius: 8px; background: transparent; width: 100%; font-size: 13px; padding: 8px; overflow-wrap: anywhere; }
.docbtn small { display: block; }
.docbtn .paper-mark { margin-top: 3px; }
.docbtn.on { background: var(--selection); color: #154e94; font-weight: 620; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.thumb { min-width: 0; padding: 6px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); overflow: hidden; }
.thumb img { max-width: 100%; height: 61px; width: 100%; object-fit: contain; }
.thumb.on { border-color: #6b9de6; color: #084d9c; background: #edf4ff; }
.reading { background: #edeff4; padding: 20px clamp(12px, 2.1vw, 36px) 45px; }
.reader-empty { min-height: min(500px, 68dvh); display: grid; justify-items: center; align-content: center; text-align: center; padding: 28px; border: 1px solid var(--line); border-radius: 17px; background: #f9fafc; }
.reader-empty button { margin-top: 20px; }
.panel { background: #fff; border: 1px solid #e1e4ec; border-radius: 15px; overflow: hidden; margin: 0 auto 16px; box-shadow: var(--shadow); }
.panelhead { min-height: 56px; padding: 11px 16px; border-bottom: 1px solid #eaedf3; flex-wrap: wrap; }
.panelhead h3 { overflow-wrap: anywhere; }
.panelbody { padding: 16px; }
.document-title { min-width: 0; }
.document-title small { font-size: 11px; }
.document-title h3 { font-size: 18px; }
.page-controls { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-controls .tool { min-width: 32px; font-size: 19px; line-height: 1; }
.toollist { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px 12px; background: #fbfcfe; border-bottom: 1px solid #eaedf3; }
.paperarea { padding: 12px; overflow: hidden; background: #fff; }
.surface { display: block; width: 100%; background: #fff; user-select: none; }
.surface.active, #board.editable { touch-action: none; cursor: crosshair; }
.translation, .answer, .bodytext { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.translation { border-top: 1px solid var(--line); padding: 16px; }
.translation-body { white-space: normal; min-width: 0; }
.translation-body { margin-top: .35em; }
.materialbar { margin: 3px 0 10px; }
.materialbar button.on { background: #fff; box-shadow: 0 1px 3px #27317410; }
#sheetpanel > .tabs { background: #f7f9fd; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.sheetarea { padding: 14px 16px; }
.sheetarea textarea { min-height: 144px; margin-top: 8px; line-height: 1.7; }
.boardtools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#board { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: radial-gradient(#c7d1e3 .7px,transparent .7px) 0 0 / 12px 12px #fafbfe; }
.deckimg { display: block; width: 100%; }
aside.right { display: flex; flex-direction: column; padding: 17px 14px 12px; border-left: 1px solid var(--line); background: #f9fafe; }
.assistant-heading { align-items: flex-start; margin: 0 3px 11px; }
.assistant-heading .muted { margin-top: 3px; }
.right .muted { font-size: 12px; }
.assistant-feed { min-height: 72px; flex: 1; overflow: auto; scrollbar-width: thin; border-top: 1px solid #e7eaf2; padding: 12px 3px; }
.assistant-feed .sidegroup { margin: 0 0 10px; border: 1px solid var(--line); padding: 10px; border-radius: 10px; background: #fff; overflow-wrap: anywhere; }
.assistant-feed strong, .answer { font-size: 13px; }
.ref { margin: 3px 3px 0 0; font-size: 11px; text-align: left; }
.composer { border: 1px solid #e2e7f1; border-radius: 13px; padding: 7px; background: #fff; box-shadow: var(--shadow); }
.composer textarea { display: block; border: 0; border-radius: 7px; font-size: 13px; min-height: 70px; max-height: 36vh; padding: 7px; }
.composer-actions, .research-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.composer button { font-size: 12px; min-height: 30px; }
.research-links { justify-content: flex-start; margin-top: 6px; padding-top: 4px; border-top: 1px solid #edf0f5; }
.research-links button { color: #315983; }

/* Dialogs and previews */
dialog { color: var(--ink); width: min(478px, calc(100vw - 28px)); max-height: 86dvh; border: 1px solid #e1e5ed; border-radius: 19px; padding: 23px; box-shadow: 0 22px 70px #18284435; }
dialog::backdrop { background: #15234355; backdrop-filter: blur(4px); }
dialog > .row { margin-bottom: 15px; }
dialog form > .primary { margin-top: 9px; }
.form-hint { font-size: 13px; }
.error { color: var(--danger); font-size: 13px; min-height: 1em; margin-top: 8px; }
.person { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 0; border-bottom: 1px solid #edf0f5; }
.person strong { flex: 1; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
#notice { display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 10px 18px; width: max-content; max-width: calc(100vw - 30px); color: #fff; background: #212836; border-radius: 10px; box-shadow: var(--shadow); z-index: 9; }
#notice.show { display: block; }
.room-leave-mask { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: #eef0f4d4; cursor: wait; }
.room-leave-mask p { display: inline-flex; align-items: center; gap: 9px; color: #303844; font-size: 15px; font-weight: 600; }
.room-leave-mask p::before {
  content: ""; width: 14px; height: 14px; border: 2px solid #bfc5cf; border-top-color: #465269;
  border-radius: 50%; animation: loading-spin .8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .room-leave-mask p::before { animation: none; } }
.chart { background: #f2f6fd; border-radius: 11px; padding: 14px; margin-bottom: 10px; }
.chartrow { display: grid; grid-template-columns: minmax(55px,25%) 1fr auto; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.chartrow i { height: 12px; border-radius: 4px; background: #6790de; }
.chart output { font-weight: 650; font-variant-numeric: tabular-nums; color: #235eac; }
.diagram { padding-left: 24px; }
.diagram li { padding: 5px 8px 12px; border-left: 2px solid #bfcfee; }
.scenario { accent-color: var(--blue); }

@media (max-width: 1060px) {
  .workspace { grid-template-columns: 176px minmax(0,1fr) 254px; }
  .auth-form { padding-inline: 32px; }
}
@media (max-width: 810px) {
  .workspace { display: block; }
  .reading { height: 100%; }
  aside.left, aside.right {
    display: none;
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 3;
    width: min(310px, 87vw);
    box-shadow: 0 12px 35px #192b4730;
  }
  aside.right { inset: 0 0 0 auto; }
  aside.left.open { display: block; }
  aside.right.open { display: flex; }
  .mobilebtn { display: inline-flex; }
  .roomtop { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 4px; padding: 7px 10px; }
  .room-title { grid-column: 1/5; }
  .room-title, .room-actions { width: 100%; }
  .room-actions { display: contents; }
  .room-actions > * { grid-row: 2; justify-content: center; }
  .room-actions button { padding-inline: 7px; min-height: 34px; }
  .room-actions .follow-button { grid-row: 1; grid-column: 5/7; justify-self: end; }
  .follow-status { display: none; }
  .top-content { padding-inline: 18px; }
  .main { padding: 42px 18px; }
}
@media (max-width: 640px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: minmax(300px,auto) minmax(160px,1fr); }
  .auth-form { grid-row: 1; padding: 34px 26px 38px; }
  .auth-form .brand { margin-bottom: 12px; }
  .auth-form .brand img { width: 78px; }
  .auth-preview { height: 100%; min-height: 160px; }
  .preview-window { width: min(63%,315px); left: 46%; top: 55%; }
  .preview-note { width: min(34%,167px); right: 13%; bottom: 9%; }
  .preview-document { padding: 8%; }
  .top { height: auto; min-height: 59px; }
  .top-content { flex-wrap: wrap; padding: 9px 12px; gap: 3px 8px; }
  .top-content > .bar { gap: 7px; }
  .top-content .brand { font-size: 14px; gap: 5px; }
  .top-content .brand img { width: 50px; }
  .top-content button { min-height: 33px; padding: 4px 7px; font-size: 12px; }
  .profile strong { max-width: 58px; }
  .profile .avatar { width: 25px; height: 25px; }
  .main { padding: 28px 14px 40px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 21px; }
  .page-heading p { font-size: 13px; }
  .page-heading .primary { min-height: 39px; font-size: 13px; padding-inline: 10px; }
  .sectionbar { flex-wrap: wrap; gap: 12px; }
  .list-tools { width: 100%; justify-content: space-between; }
  .sectionbar .search-field { flex: 1; min-width: 100px; }
  .sectionbar .search-field input { width: 100%; }
  .report-row { gap: 6px; grid-template-columns: minmax(0,1fr) max-content max-content; }
  .report-link { gap: 7px; padding-left: 2px; }
  .report-actions { gap: 0; }
  .report-actions .icon-button { min-width: 32px; }
  .report-doc { width: 27px; height: 33px; }
  .roomtop h3 { font-size: 14px; }
  .roomtop .position { font-size: 11px; }
  .roomtop button { font-size: 12px; }
  .reading { padding-top: 12px; }
  .panelhead { padding-inline: 10px; }
  .paperarea { padding: 5px; }
  .sheetarea > .row { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}

/* The original and the explanation are independently scrollable on desktop. */
.reader-stack { min-width: 0; }
.reader-divider { display: none; }
.rail-tabs { flex: none; margin-bottom: 14px; }
.rail-tabs button { flex: 1; min-width: 0; padding-inline: 5px; }
.rail-pane { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: auto; }
.rail-pane .person { justify-content: space-between; margin: 0 2px; overflow-wrap: anywhere; }
.rail-pane .person strong { min-width: 0; }
.rail-pane .person a { margin-left: auto; font-size: 13px; white-space: nowrap; }
.rail-pane .person .connected { color: #24634d; }
#online-count { color: #24634d; font-size: 11px; }
#online-count:empty { display: none; }
#ink-filter { margin-left: auto; font-size: 12px; border: 0; background: #eef1f7; padding: 3px 5px; }
.document-panel .strokes [data-stroke] polyline { pointer-events: visibleStroke; }
.document-panel .strokes text { pointer-events: none; }
.document-panel .pointers { pointer-events: none; }
.canvas-block { margin: 11px 0; background: #f8faff; border: 1px solid #e1e7f2; border-radius: 11px; padding: 11px 13px; min-width: 0; }
.canvas-block header { display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.canvas-block header strong { overflow-wrap: anywhere; }
.canvas-block .formula { overflow: auto; font-size: 17px; }
.canvas-block .katex-display { margin: 12px 0; }
.block-table { overflow: auto; }
.block-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.block-table th, .block-table td { padding: 6px 9px; border-bottom: 1px solid #e2e7ef; text-align: left; }
.block-table th { background: #edf2fa; }
.bar-segment { display: grid; grid-template-columns: minmax(70px,25%) 1fr auto; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar-segment i { display: block; border-radius: 3px; height: 10px; background: #5785cd; }
.bar-segment i.negative { background: #b76153; }

@media (min-width: 811px) {
  .reading:has(.reader-stack) { padding: 0; overflow: hidden; }
  .reader-stack { display: grid; grid-template-rows: minmax(0,var(--original,57%)) 12px minmax(0,1fr); height: 100%; }
  .original-pane, .explanation-pane { overflow: auto; min-height: 0; padding: 14px clamp(12px,2vw,27px); scrollbar-width: thin; }
  .original-pane .panel { margin-bottom: 0; }
  .explanation-pane { padding-top: 8px; padding-bottom: 24px; }
  .reader-divider { display: grid; place-items: center; cursor: ns-resize; touch-action: none; }
  .reader-divider i { border-radius: 4px; width: 38px; height: 4px; background: #aeb7c9; }
  .reader-divider:is(:hover,:focus-visible) i { background: var(--blue); }
  .reader-divider:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
  .document-panel .panelhead { position: sticky; top: 0; background: #fff; }
}
@media (max-width: 810px) {
  #online-count { display: none; }
}

@media (max-width: 1070px) {
  .room-title .brand > span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
}
@media (max-width: 810px) {
  .room-title { gap: 2px; }
  .room-title .brand img { width: 36px; }
  .room-title .icon-button { min-width: 26px; padding-inline: 4px; }
  .room-actions .icon-button { display: inline-flex; min-width: 34px; }
}

[hidden] { display: none !important; }
.roomtop { position: relative; }
.room-title { gap: 5px; }
.session-state { font-weight: 620; }
button.session-state.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
button.session-state.is-live { color: #96332d; border-color: #f1d9d5; background: #fff3f1; }
button.session-state.is-live:hover { background: #fae5e1; }
button.follow-button { background: #fff; border-color: #dce5f0; }
button.follow-button[aria-pressed=true] { background: #edf4ff; }
.rail-heading { gap: 5px; }
.history-tools { display: flex; align-items: center; gap: 2px; }
.history-tools .icon-button { padding: 2px; border-radius: 7px; min-width: 25px; min-height: 29px; color: #174f95; }
.history-tools .icon-button:disabled { background: transparent; color: #a4acb9; opacity: 1; cursor: default; }
.history-tools .icon-button .ui-icon { width: 16px; height: 16px; }
.position-enter { animation: presentation-in .17s ease-out; }
@keyframes presentation-in { from { opacity: .63; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

.member-popover {
  position: absolute;
  right: 17px;
  top: calc(100% + 6px);
  width: min(395px, calc(100vw - 20px));
  max-height: min(560px, calc(100dvh - 115px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  background: #fff;
  border: 1px solid #dfe4ee;
  border-radius: 14px;
  box-shadow: 0 12px 35px #14274e23;
  animation: popover-in .15s ease-out;
}
.member-popover:focus { outline: none; }
.member-popover header { margin-bottom: 8px; }
.member-popover h4 { font-size: 13px; margin: 0; }
.member-popover #invite-search { width: 100%; }
.translation-popover { width: min(355px, calc(100vw - 20px)); }
.roomtop .translation-trigger { position: relative; min-width: 34px; color: #3c5576; }
.translation-trigger[aria-expanded=true] { background: #ecf2fa; }
.translation-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #a6753d; }
.translation-trigger .translation-dot { position: absolute; inset: 7px 5px auto auto; border: 1px solid #fff; }
.translation-dot[data-running=true], .translation-trigger[data-running=true] .translation-dot { background: #168166; }
.translation-jobs { list-style: none; margin: 0; padding: 0; }
.translation-job { display: flex; align-items: start; gap: 9px; padding-block: 9px; border-top: 1px solid #eef1f6; }
.translation-job .translation-dot { margin-top: 7px; }
.translation-job strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.translation-job small { display: block; margin-top: 2px; font-size: 12px; }
.account-actions { flex: none; gap: 4px; }
.account-actions .icon-button, .member-tools .icon-button { min-width: 30px; min-height: 30px; }
.account-actions .ui-icon, .member-tools .ui-icon { width: 15px; height: 15px; }
.token-table { overflow: auto; scrollbar-width: thin; }
.token-table table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.token-table :is(th,td) { padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.token-table :is(thead th:first-child,tbody th) { text-align: left; }
.token-table small { display: block; font-weight: 400; }
.speaker-history { display: flex; gap: 4px; margin-left: auto; }
.shared-record-list { display: grid; gap: 4px; max-height: 56dvh; overflow: auto; }
.shared-record-row { align-items: flex-start; flex-direction: column; text-align: left; }
.member-line { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 8px 0; border-bottom: 1px solid #eef1f6; }
.member-line .dot { flex: none; }
.member-name { flex: 1; overflow-wrap: anywhere; min-width: 0; }
.member-name small { display: block; font-size: 11px; }
.member-name .connected { color: #24634d; }
.member-tools { display: flex; flex-wrap: wrap; justify-content: end; gap: 2px; }
.member-annotation-controls { padding: 9px 0; border-bottom: 1px solid var(--line); }
.member-annotation-controls > .row { flex-wrap: wrap; gap: 5px; }
.member-annotation-controls p { margin: 6px 0 0; color: #536174; font-size: 11px; line-height: 1.5; }
.member-permission {
  min-height: 30px; padding: 4px 8px; white-space: nowrap; font-size: 12px; font-weight: 600;
  color: #34445a; background: #fff; border: 1px solid #b8c3d1; border-radius: 7px;
}
.member-permission:hover:not(:disabled) { background: #eff3f8; border-color: #8495aa; }
.member-permission.is-granted { background: #e9f5ef; border-color: #83b8a4; color: #145a41; }
.member-permission.is-granted:hover:not(:disabled) { background: #dcf0e6; border-color: #579c82; }
.voice-host-row { padding: 4px 0 9px; border-bottom: 1px solid var(--line); gap: 8px; font-size: 13px; }
.voice-host-button .ui-icon { width: 14px; height: 14px; }
.voice-controls { display: inline-flex; align-items: center; gap: 2px; }
.voice-controls .voice-mic.voice-connecting { opacity: 1; }
.voice-mic.voice-connecting .ui-icon { display: none; }
.voice-mic.voice-connecting::before {
  content: ""; width: 16px; height: 16px; box-sizing: border-box;
  border: 2px solid #c9daec; border-top-color: #195ea7; border-radius: 50%;
  animation: loading-spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .voice-mic.voice-connecting::before { animation: none; } }
.voice-controls .voice-mic.voice-speaking { color: #126047; background: #e5f4ec; }
.voice-controls .voice-mic.voice-issue { color: #966322; }
.voice-controls .voice-playback-muted { color: #835622; background: #f8efe2; }
.source-navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 10px; }
.source-tools { display:flex; align-items:center; gap:5px; flex-wrap:wrap; padding:3px 12px; border-bottom:1px solid var(--line); }
.source-tools .toollist,.source-tools .shared-ink-tools { margin:0; padding:0; border:0; }
.translation-switch { margin-left:auto; min-height:28px; gap:7px; border:0; background:transparent; color:#425064; font-size:12px; white-space:nowrap; }
.translation-switch > span { display:inline-block; width:26px; height:15px; border-radius:999px; background:#768397; padding:2px; }
.translation-switch > span::after { content:""; display:block; width:11px; height:11px; background:#fff; border-radius:50%; transition:transform .16s ease; }
.translation-switch[aria-checked="true"] > span { background:#155eaf; }
.translation-switch[aria-checked="true"] > span::after { transform:translateX(11px); }
@media(prefers-reduced-motion:reduce){ .translation-switch > span::after { transition:none; } }
.section-outline-label { gap:8px; margin-bottom:10px; }
.section-outline-label strong { min-width:0; overflow-wrap:anywhere; }
.section-outline-label small,.section-outline-item small { flex:none; color:#536174; }
.section-outline-list { display:grid; gap:5px; max-height:47dvh; overflow:auto; padding:3px; }
.section-outline-item { display:block; text-align:start; width:100%; padding:9px 11px; }
.section-outline-item span { display:flex; justify-content:space-between; gap:7px; align-items:baseline; }
.section-outline-item p { margin:4px 0 0; font-size:12px; color:#536174; line-height:1.5; overflow-wrap:anywhere; }
.section-outline-actions { justify-content:flex-end; margin-top:12px; }
.mp-matches { overflow: auto; max-height: 175px; }
.mp-groups-heading { border-top: 1px solid #e3e8ef; padding-top: 8px; margin-top: 13px; }
.mp-selected { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.mp-chip { min-height: 28px; padding: 4px 7px; font-size: 12px; background: #f4f7fc; }
.mp-chip.on { color: #104e9c; border-color: #b1cdf2; background: #e8f1ff; }
.mp-error { color: var(--danger); font-size: 12px; }
.mp-error:not(:empty) { padding: 4px 0 7px; }

.site-select { min-height: 34px; min-width: 0; width: 100%; justify-content: space-between; gap: 8px; font-size: inherit; }
.site-select span { text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.site-select .ui-icon { color: #626e80; width: 16px; height: 16px; }
.toollist .site-select { width: max-content; min-height: 30px; margin-left: auto; font-size: 12px; }
.site-options {
  position: fixed;
  margin: 0;
  inset: auto;
  max-width: calc(100vw - 16px);
  overflow: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid #dbe2ed;
  border-radius: 10px;
  box-shadow: 0 10px 30px #1e305325;
  z-index: 20;
  color: var(--ink);
  animation: popover-in .13s ease-out;
}
.site-options button { display: block; width: 100%; font-size: 13px; border: 0; text-align: left; padding: 7px 9px; }
.site-options button[aria-selected=true] { background: #edf4ff; color: #134d96; }
.site-options button:focus-visible { outline-offset: -2px; }
@keyframes popover-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.assistant-turn { padding: 13px 4px; border-bottom: 1px solid #e6ebf3; }
.assistant-turn > strong { display: block; margin-bottom: 7px; overflow-wrap: anywhere; font-size: 13px; }
.assistant-source { overflow-wrap: anywhere; }
.answer-sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.answer-sources a { display: inline-block; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; padding: 5px 7px; overflow-wrap: anywhere; }
.composer-actions { justify-content: flex-end; }

@media(max-width:810px){
  .room-actions { display: flex; grid-column: 1/-1; grid-row: 2; align-items: center; gap: 5px; }
  .room-actions .follow-button { margin-left: auto; }
  .room-actions [data-act=save] { margin-left: auto; }
  .room-actions .follow-button:not([hidden]) ~ [data-act=save] { margin-left: 0; }
  .room-title { grid-column: 1/-1; }
  .member-popover { right: 8px; }
}
@media(prefers-reduced-motion:reduce){
  .position-enter, .member-popover, .site-options { animation:none; }
}

/* Room workspace */
.workspace.new-workspace {
  grid-template-columns: clamp(180px, 17vw, 236px) minmax(0,1fr) clamp(282px, 26vw, 372px);
  background: #f2f4f8;
}
.new-workspace .left { padding: 16px 12px 24px; }
.new-workspace .right { padding: 12px 11px 11px; background: #f8f9fc; }
.new-workspace .reading { position: relative; padding: 0; overflow: hidden; background: #edf0f5; }
.work-switch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; width: max-content; max-width: calc(100% - 24px); padding: 3px;
  border: 1px solid #d7d9de;
  border-radius: 999px;
}
.work-tabs, .work-tabs-fixed, .work-tabs-open { display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; }
.work-tabs-fixed { flex: none; }
.work-tabs-open { overflow-x: auto; scrollbar-width: none; overscroll-behavior-inline: contain; margin-left: 5px; border-left: 1px solid #dbdce0; }
.work-tabs-open::-webkit-scrollbar { display: none; }
.work-tabs button {
  min-height: 29px; padding: 3px 12px; border: 1px solid transparent; border-radius: 999px;
  color: #555960; background: transparent; font-size: 12px; font-weight: 550; gap: 6px;
}
.work-tabs-fixed button[aria-selected=true], .paper-tab.is-active {
  color: #242527; background: #e7e7e9; border-color: #e1e1e3;
}
.work-tabs-fixed button:not([aria-selected=true]):not(:disabled):hover, .paper-tab:not(.is-active):hover { background: #efeff0; }
.work-tabs-fixed button:disabled { opacity: 1; color: #76787e; }
.work-tabs-fixed button .ui-icon { width: 12px; height: 12px; }
.paper-tab { display: flex; align-items: center; flex: 0 0 auto; max-width: min(190px, 41cqw); border-radius: 999px; }
.paper-tab.is-active { box-shadow: inset 0 0 0 1px #e1e1e3; }
.paper-tab > [role=tab] { justify-content: flex-start; min-width: 0; flex: 1; padding: 2px 2px 2px 10px; }
.paper-tab.is-active > [role=tab] { color: inherit; }
.paper-tab > [role=tab] .ui-icon { width: 13px; height: 13px; color: #6f7278; }
.paper-tab > [role=tab] span { overflow: hidden; text-overflow: ellipsis; }
.paper-tab .tab-close { flex: none; min-height: 24px; min-width: 24px; padding: 2px; margin-right: 2px; color: #63666d; }
.paper-tab .tab-close:focus-visible, .work-tabs [role=tab]:focus-visible { outline-offset: -2px; }
.paper-tab .tab-close:hover { color: #242527; background: #dcdcdf; }
.paper-tab .tab-close svg { width: 12px; height: 12px; }
.live-dot { display: inline-block; width: 6px; height: 6px; flex: none; background: #09835e; border-radius: 50%; }
.work-stage { height: 100%; min-height: 0; padding-top: 46px; overflow: hidden; }
.work-stage[hidden], .chat-pane[hidden], #share-end:empty, .pdf-actions [hidden], .composer-file[hidden] { display: none; }
.stage-next { animation: workspace-next .21s cubic-bezier(.2,.7,.2,1) both; }
.stage-prev { animation: workspace-prev .21s cubic-bezier(.2,.7,.2,1) both; }
@keyframes workspace-next { from { opacity: .45; transform: translateX(15px); } }
@keyframes workspace-prev { from { opacity: .45; transform: translateX(-15px); } }
.share-workspace { white-space: nowrap; }
.share-workspace.is-live { color: #145e48; background: #e4f2ec; border-color: #c7e3d6; }
#share-end .icon-button { color: #965344; }
.new-workspace .reader-stack { display: grid; grid-template-rows: minmax(0,var(--original,57%)) 14px minmax(0,1fr); height: 100%; }
.new-workspace .original-pane, .new-workspace .explanation-pane {
  min-height: 0; overflow: auto; padding: 0 clamp(9px,1.5vw,21px) 9px; scrollbar-width: thin;
}
.new-workspace .explanation-pane { padding-top: 2px; padding-bottom: 12px; }
.new-workspace .reader-divider { display: grid; place-items: center; cursor: ns-resize; touch-action: none; }
.new-workspace .reader-divider i { width: 38px; height: 4px; border-radius: 999px; background: #a6b2c4; }
.new-workspace .reader-divider:is(:hover,:focus-visible) i { background: #555f6e; }
.new-workspace .reader-divider.locked { cursor: default; pointer-events: none; }
.new-workspace .reader-divider.locked i { background: #cad1df; }
.new-workspace .panel { border-radius: 12px; margin-bottom: 0; }
.new-workspace .panelhead { min-height: 43px; padding: 8px 13px; gap: 7px; }
.new-workspace .panelhead h3 { font-size: 14px; }
.new-workspace .paperarea { padding: clamp(8px,1.3vw,16px); }
.new-workspace .toollist { padding: 3px 9px; }
.new-workspace .toollist .tool { min-height: 27px; }
.new-workspace .sheetarea { padding: 10px 12px; }
.new-workspace .sheetarea textarea { min-height: 114px; }
.new-workspace .document-panel .panelhead { position: static; }
.new-workspace .source-img,.new-workspace .shared-surface,.new-workspace .shared-board { display: block; width: 100%; }
.shared-surface.active { cursor: crosshair; touch-action: none; }
.new-workspace .surface :is(.pointers,.drawing), .new-workspace .shared-surface :is(.pointers,.drawing,.excerpt-hits) { pointer-events: none; }
.excerpt-hits { pointer-events: none; }
.new-workspace .shared-board { border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.speaker-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #546377; margin: 1px 0 7px 4px; }
.speaker-meta strong { font-weight: 650; color: #244457; }
.work-empty,.source-placeholder { min-height: 100%; display: grid; align-content: center; justify-items: center; text-align: center; gap: 8px; padding: 18px; color: #48596e; }
.work-empty h2, .source-placeholder h3 { margin: 0; }
.source-placeholder p,.canvas-empty p { font-size: 13px; margin: 0 0 5px; color: #57667a; }
.empty-symbol { width: 39px; height: 39px; display: inline-grid; place-items: center; background: #e2eaf7; border-radius: 11px; color: #406690; }
.empty-symbol .ui-icon { width: 21px; height: 21px; }
.canvas-empty { padding: 10px 0 4px; }
.canvas-empty .primary { margin-top: 4px; }
.legacy-select { margin: 0; font-size: 12px; }
.file-zone { margin: 4px 0 15px; }
.file-zone header { display: flex; align-items: center; justify-content: space-between; min-height: 31px; gap: 4px; padding-left: 6px; }
.file-zone h4 { font-size: 12px; color: #3d4c62; font-weight: 680; margin: 0; }
.file-zone .side-add { min-width: 28px; padding: 3px; background: transparent; color: #4c6381; }
.file-zone .side-add:hover { background: #e7eef8; }
.file-empty { padding: 5px 6px; color: #59677b; font-size: 12px; margin: 0; }
.file-row { position: relative; display: flex; align-items: center; border-radius: 8px; min-width: 0; }
.file-row:hover,.file-row.selected { background: #eaebee; }
.file-open {
  display: flex; flex: 1; align-items: flex-start; justify-content: flex-start; min-width: 0; width: 100%;
  text-align: left; white-space: nowrap; border: 0; padding: 6px 5px; gap: 6px; background: transparent; font-size: 12px;
}
.file-open svg { width: 16px; height: 16px; color: #466b98; flex: none; }
.file-open > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.file-open small { display: block; overflow: hidden; text-overflow: ellipsis; color: #5e6d80; font-size: 10px; margin-top: 2px; }
.file-menu > button { min-width: 28px; min-height: 27px; padding: 2px; }
.file-menu .ui-icon { width: 15px; height: 15px; }
.file-popover {
  position: absolute; top: calc(100% - 1px); right: 2px; min-width: 142px; z-index: 2;
  padding: 3px; border: 1px solid #dfe5ee; background: white; box-shadow: 0 6px 21px #192f4b22; border-radius: 9px;
}
.file-popover button { width: 100%; text-align: left; border: 0; justify-content: flex-start; gap: 6px; }
.file-popover .remove-file { color: #993a35; }
.excerpt-open { display: flex; justify-content: space-between; width: 100%; border: 0; gap: 4px; background: transparent; padding: 6px; min-height: 27px; font-size: 12px; }
.excerpt-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.excerpt-open small { flex: none; }
.excerpt-open.on { background: #eaebee; color: var(--ink); }
.new-workspace .thumb.on { border-color: #9498a0; color: var(--ink); background: #eeeff1; }

.pdf-stage { display: flex; flex-direction: column; }
.pdf-toolbar,.pdf-actions { display: flex; align-items: center; gap: 6px; margin: 0 clamp(9px,1.5vw,21px); }
.pdf-toolbar {
  justify-content: space-between; border-radius: 10px 10px 0 0; background: #fff;
  min-height: 43px; padding: 5px 9px; border: 1px solid #e0e5ef;
}
.pdf-ident { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.pdf-ident span { font-size: 10px; color: #52667f; flex: none; }
.pdf-ident strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pdf-steps,.pdf-pageform { display: flex; align-items: center; white-space: nowrap; gap: 3px; }
.pdf-pageform { margin: 0; color: #53627a; font-size: 11px; }
.pdf-pageform label { margin: 0; }
.pdf-pageform input { width: 42px; padding: 2px 4px; min-height: 25px; text-align: center; font-size: 12px; }
.pdf-steps button { min-width: 25px; padding: 2px; min-height: 26px; }
.pdf-actions { flex-wrap: wrap; background: #f9fbfe; border: 1px solid #e0e5ef; border-top: 0; padding: 5px 7px; }
.pdf-actions button { min-height: 27px; font-size: 11px; }
.pdf-instruction { color: #4b5e76; font-size: 11px; margin: 0; }
.pdf-instruction:empty { display: none; }
.pdf-scroll { min-height: 0; flex: 1; overflow: auto; margin: 0 clamp(9px,1.5vw,21px); scrollbar-width: thin; }
.pdf-paper { position: relative; background: white; width: min(100%,870px); margin: 0 auto; }
.pdf-paper img { width: 100%; display: block; user-select: none; }
.pdf-paper.selecting { cursor: crosshair; touch-action: none; }
.pdf-selection { position: absolute; inset: 0; pointer-events: none; }
.pdf-selection i { position: absolute; background: #bd98553a; outline: 1px solid #966e3878; border-radius: 1px; }
.pdf-excerpts { background: #fff; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pdf-excerpts h3 { font-size: 12px; margin-right: 4px; }

.new-workspace .rail-pane { overflow: hidden; }
.chat-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); position: relative; border-bottom: 1px solid #dce4ef; }
.chat-switch button { width: 100%; min-height: 38px; border: 0; border-radius: 7px 7px 0 0; padding: 5px 8px; background: transparent; color: #465976; font-size: 12px; gap: 5px; }
.chat-switch button:hover { background: #edf2f9; }
.chat-switch button.on { color: #174c85; font-weight: 690; }
.chat-switch-indicator { position: absolute; inset: auto auto -1px 0; width: 50%; height: 2px; background: #2868ab; border-radius: 2px 2px 0 0; pointer-events: none; transition: transform .20s cubic-bezier(.2,.64,.25,1); }
.chat-switch[data-active=group] .chat-switch-indicator { transform: translateX(100%); }
.chat-switch .ui-icon { width: 15px; height: 15px; }
.group-unread { background: #18579d; color: #fff; border-radius: 999px; min-width: 16px; padding: 1px 4px; font-size: 10px; }
.chat-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.assistant-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #51637b; font-size: 11px; padding: 8px 4px 4px; }
.chat-feed { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; border: 0; padding: 9px 3px; overscroll-behavior: contain; }
.chat-day { text-align: center; padding: 11px 0 6px; color: #5f6876; font-size: 11px; }
.chat-empty { text-align: center; margin: 15px 0 0; color: #627189; font-size: 12px; }
.chat-composer { background: #fff; border: 1px solid #dfe5ee; border-radius: 16px; padding: 6px 7px; margin-top: 6px; box-shadow: 0 3px 13px #233b5710; }
.chat-composer:focus-within { border-color: #90aed9; box-shadow: 0 0 0 2px #99b9e62d; }
.chat-composer textarea { width: 100%; padding: 6px 6px 2px; min-height: 44px; resize: vertical; background: #fff; font-size: 13px; }
.chat-composer textarea:focus { outline: none; box-shadow: none; }
.chat-composer .composer-actions { display: flex; justify-content: space-between; min-height: 31px; gap: 8px; }
.chat-composer .chat-send {
  min-width: 31px; min-height: 31px; padding: 4px; border-radius: 50%; background: #1762b7; border-color: #1762b7;
}
.chat-composer .chat-send .ui-icon { width: 16px; height: 16px; }
.compression {
  --progress: 0%; display: inline-flex; align-items: center; gap: 5px; color: #53647a;
  padding: 3px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; font-size: 11px;
}
.compression i { width: 12px; height: 12px; background: conic-gradient(#246eb9 var(--progress),#dce5f1 0); border-radius: 50%; position: relative; }
.compression i::after { content: ""; position: absolute; background: #fff; border-radius: 50%; inset: 3px; }
.compression b { font-weight: 650; }
.composer-file { display: flex; align-items: center; justify-content: space-between; border-radius: 7px; background: #edf2fa; padding: 1px 2px 1px 7px; font-size: 11px; }
.composer-file span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.composer-file button { min-height: 23px; min-width: 24px; padding: 0; }
.research-turn { display: flex; flex-direction: column; align-items: stretch; gap: 7px; margin-bottom: 14px; }
.research-pane .assistant-feed { overflow-x: hidden; }
.message-bubble {
  max-width: 91%; border-radius: 14px 14px 14px 4px; padding: 7px 10px; background: #e9edf4;
  color: #202f44; white-space: pre-wrap; overflow-wrap: anywhere; width: fit-content; font-size: 13px; line-height: 1.5;
}
.message-bubble p { margin: 0; }
.message-bubble.own,.group-message.own .message-bubble { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #dfeafb; color: #122f56; }
.message-flight { animation: send-flight .34s cubic-bezier(.2,.8,.25,1) both; transform-origin: bottom right; }
@keyframes send-flight { from { opacity: .2; transform: translate(12px,30px) scale(.88); } }
.research-answer .answer { margin: 0 2px; color: #253349; line-height: 1.65; white-space: normal; min-width: 0; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content p, .markdown-content :is(ul,ol,pre,blockquote) { margin: .65em 0; }
.markdown-content :is(ul,ol) { padding-inline-start: 1.45em; }
.markdown-content li > p { margin: .2em 0; }
.markdown-content :is(h1,h2,h3,h4,h5,h6) { margin: .9em 0 .35em; font-size: 1em; line-height: 1.45; letter-spacing: normal; }
.markdown-content :is(h1,h2) { font-size: 1.13em; }
.markdown-content blockquote { padding-inline-start: 10px; border-inline-start: 2px solid #cdd4de; color: #545d6b; }
.markdown-content :is(pre,code) { background: #eef0f3; border-radius: 4px; }
.markdown-content pre { padding: 8px 10px; overflow-x: auto; overflow-wrap: normal; }
.markdown-content code { padding: .1em .25em; font: .92em/1.55 ui-monospace, monospace; }
.markdown-content pre code { padding: 0; }
.research-math-inline { display: inline-block; vertical-align: middle; max-width: 100%; overflow-x: auto; white-space: nowrap; padding-block: .06em; scrollbar-width: thin; }
.research-math-block, .research-table { display: block; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.research-math-block .katex-display { margin: .4em 0; padding: .3em 1px .4em; width: max-content; min-width: 100%; }
.research-math-error { color: #685346; font-size: .93em; }
.research-math-error summary { cursor: pointer; }
.research-table { margin: .65em 0; }
.research-table table { border-collapse: collapse; max-width: 100%; font-size: .95em; }
.research-table :is(th,td) { border: 1px solid #d8dde5; padding: 5px 8px; text-align: start; overflow-wrap: normal; }
.research-table th { background: #eef0f3; }
.research-answer .chat-error { color: #953a34; }
.research-answer .tool { margin-top: 4px; min-height: 26px; }
.answer-sources a { display: inline-flex; }
.answer-sources .source-jump { color:#18528b; background:#eaf2fb; border-color:#d1e0f2; text-align:left; }
.thinking { display: inline-flex; align-items: center; gap: 5px; color: #52647c; font-size: 12px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: #5b83b4; animation: pulse-dot 1s infinite alternate; }
@keyframes pulse-dot { to { opacity: .3; } }
.group-message { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-bottom: 11px; }
.group-message.own { align-items: flex-end; }
.group-message header { display: flex; gap: 5px; align-items: baseline; color: #53657e; font-size: 10px; }
.group-message header strong { color: #2f445e; font-size: 11px; }
.message-attachment { display: grid; gap: 4px; }
.message-attachment img { width: auto; max-width: 100%; max-height: 220px; object-fit: contain; display: block; border-radius: 8px; }
.attachment-link { color: #204c7a; display: flex; align-items: center; text-decoration: none; gap: 5px; font-size: 11px; }
.attachment-link .ui-icon { width: 14px; height: 14px; flex: none; }
.attachment-link span { min-width: 0; overflow-wrap: anywhere; }
.load-chat { display: flex; margin: 0 auto 10px; }

@media (max-width: 810px) {
  .new-workspace aside.right { width: min(365px,91vw); }
  .work-stage { padding-top: 46px; }
  .work-tabs button, .work-switch .tab-close { min-height: 29px; }
  .new-workspace .reader-divider { padding: 4px 0; }
  .new-workspace .toollist .tool,.pdf-actions button { min-height: 32px; }
  .new-workspace .file-open, .new-workspace .file-menu > button { min-height: 36px; }
  .new-workspace .chat-send { min-width: 37px; min-height: 37px; }
  .room-actions .share-workspace { margin-left: auto; }
  .room-actions .share-workspace ~ [data-act=save] { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-next,.stage-prev,.message-flight,.thinking i { animation: none; }
}

/* Room layout controls and responsive reading measure */
.room-rails, .presentation-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.room-rails { margin-right: auto; border-left: 1px solid var(--line); padding-left: 8px; }
.room-rails .rail-toggle { min-width: 33px; color: #68798f; }
.room-rails .rail-toggle[aria-expanded=true] { color: #184f87; background: #ecf2fa; }
.room-actions .presentation-actions .share-workspace,
.room-actions .presentation-actions [data-act=save] { margin-left: 0; }
.new-workspace .rail-heading { justify-content: flex-start; gap: 8px; }
.new-workspace .rail-heading .history-tools { margin-left: 0; gap: 1px; }
.new-workspace .history-tools .icon-button { min-width: 30px; padding: 3px; }
.new-workspace .history-tools .ui-icon { width: 20px; height: 20px; }
.file-zone header { padding-left: 2px; }
.file-fold {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px;
  padding: 4px; border: 0; border-radius: 6px; background: transparent;
  appearance: none; min-height: 29px; font-size: inherit; font-weight: inherit; color: inherit;
}
.file-fold .ui-icon { width: 14px; height: 14px; flex: none; color: #52657f; }
.file-fold:hover { background: #e8eef8; }
.new-workspace .reading { container-type: inline-size; }
.original-art, .original-material > .translation { min-width: 0; }
.new-workspace .original-art :is(.source-img,.surface,.shared-surface) {
  max-width: 880px; margin-inline: auto;
}
.new-workspace .original-art [data-excerpt] { max-width: var(--excerpt-width); margin-inline: 0 auto; }
.new-workspace .document-panel .page-controls button { font-size: 12px; }
.new-workspace .sheetarea .bodytext { max-inline-size: 92ch; }
.new-workspace .explanation-pane .source-img { width: min(100%,1100px); margin-inline: auto; }
@container (min-width: 930px) {
  .original-material.has-translation { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr); align-items: stretch; }
  .original-material.has-translation > .translation { border-top: 0; border-left: 1px solid var(--line); padding: 14px 19px; }
}
@media (min-width: 811px) {
  .workspace.new-workspace {
    --files-width: clamp(180px,17vw,236px);
    --chat-width: clamp(282px,26vw,372px);
    --left-track: var(--files-width); --right-track: var(--chat-width);
    grid-template-columns: var(--left-track) minmax(0,1fr) var(--right-track);
    transition: grid-template-columns .23s cubic-bezier(.2,.68,.25,1);
  }
  .new-workspace.left-collapsed { --left-track: 0px; }
  .new-workspace.right-collapsed { --right-track: 0px; }
  .new-workspace .rail-clip { min-height: 0; overflow: clip; }
  .new-workspace .rail-clip > aside { height: 100%; overflow: auto; }
  .new-workspace .left { width: var(--files-width); }
  .new-workspace .right { width: var(--chat-width); }
  .new-workspace .left, .new-workspace .right {
    visibility: visible; transition: transform .23s cubic-bezier(.2,.68,.25,1), visibility 0s;
  }
  .new-workspace.left-collapsed .left, .new-workspace.right-collapsed .right { visibility: hidden; transition-delay: 0s,.23s; }
  .new-workspace.left-collapsed .left { transform: translateX(-32px); }
  .new-workspace.right-collapsed .right { transform: translateX(28px); }
}
@media (max-width: 810px) {
  .room-actions { width: auto; grid-column: 3/-1; justify-self: end; }
  .room-rails { grid-row: 2; grid-column: 1/3; border: 0; padding: 0; }
  .room-rails, .presentation-actions { gap: 3px; }
  .new-workspace { overflow: clip; }
  .new-workspace .rail-clip { display: contents; }
  .new-workspace aside.left, .new-workspace aside.right {
    display: block; visibility: hidden; transition: transform .24s cubic-bezier(.2,.68,.25,1), visibility 0s linear .24s;
    box-shadow: 0 8px 25px #172f4a21;
  }
  .new-workspace aside.right { display: flex; transform: translateX(104%); }
  .new-workspace aside.left { transform: translateX(-104%); }
  .new-workspace aside.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
}

/* Continuous canvas */
.new-workspace .reader-stack:has(.board-panel) { grid-template-rows: minmax(0,var(--original,49%)) 14px minmax(0,1fr); }
.new-workspace .reader-stack.auto-original { grid-template-rows: fit-content(var(--original,49%)) 14px minmax(0,1fr); }
.board-panel { display: flex; flex-direction: column; min-height: 100%; overflow: hidden; }
.canvas-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; min-height: 47px;
  padding: 5px 8px; border-bottom: 1px solid var(--line); background: white; flex: none;
}
.canvas-toolbar > strong { font-size: 14px; padding: 0 5px; }
.canvas-tools { display: flex; align-items: center; gap: 2px; border-right: 1px solid var(--line); padding-right: 5px; }
.canvas-toolbar-last { margin-left: auto; border: 0; padding-right: 0; }
.canvas-tool.icon-button { min-width: 28px; min-height: 29px; padding: 4px; }
.canvas-tool .ui-icon { height: 17px; width: 17px; }
.canvas-tool[aria-pressed=true] { background: #e7effb; color: #15518e; }
.canvas-page-count { font-size: 11px; white-space: nowrap; color: #596b83; }
.canvas-toolbar .bindings-tools .tool { font-size: 11px; padding: 4px 6px; min-height: 29px; gap: 3px; white-space: nowrap; }
.bindings-tools .ui-icon { width: 14px; height: 14px; }
.canvas-version-tools { align-items: flex-start; }
.canvas-versions { display: grid; gap: 2px; padding: 1px 0; }
.canvas-versions label, .paragraph-controls label { margin: 0; }
.canvas-versions .site-select { min-height: 25px; padding: 2px 4px; min-width: 78px; font-size: 11px; }
.canvas-versions small { font-size: 10px; color: #52637b; line-height: 1.15; }
.canvas-versions .site-select span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paragraph-controls .site-select { min-height: 28px; padding: 3px 5px; font-size: 12px; }
.board-zero,.board-empty { min-height: 175px; flex: 1; display: grid; place-items: center; background: #f9fbff; padding: 15px; }
.board-zero { min-height: 0; }
.board-zero button { min-width: 48px; min-height: 48px; color: #315b8b; border: 1px dashed #98aac4; border-radius: 12px; background: #fff; }
.board-zero button:hover { color: #164f90; background: #eaf1fc; }
.board-zero .ui-icon { width: 23px; height: 23px; }
.board-progress { font-size: 11px; padding: 3px 6px; color: #4d6280; }
.scene-scroll {
  flex: 1; min-height: 155px; width: 100%; overflow: hidden;
  position: relative; overscroll-behavior: contain;
}
.board-panel:has(.scene-scroll) { max-height: 100%; }
.scene-surface {
  position: absolute; inset: 0; overflow: hidden; user-select: none; touch-action: pan-y pinch-zoom;
}
.scene-surface[data-mode="ink"], .scene-surface[data-mode="erase"], .scene-surface[data-mode="text"] { touch-action: none; cursor: crosshair; }
.scene-world { position: absolute; inset: 0 auto auto 0; width: 0; height: 0; transform-origin: 0 0; }
.scene-surface:is([data-mode="select"],[data-mode="pan"]) { cursor: grab; }
.scene-surface[data-mode="pan"] { touch-action: none; }
.scene-surface[data-panning], .scene-surface[data-panning] * { cursor: grabbing; }
.scene-surface[data-mode="select"] .scene-item { touch-action: none; cursor: move; }
.scene-item { position: absolute; min-width: 0; box-sizing: border-box; }
.scene-item > img, .scene-item > svg { width: 100%; height: 100%; display: block; }
.scene-item > img { object-fit: fill; pointer-events: none; }
.scene-asset > img { box-shadow: 0 0 0 1px #cbd6e1; }
.scene-ink { pointer-events: none; }
.scene-ink polyline { pointer-events: stroke; }
.scene-ink .scene-ink-hit { pointer-events:none; }
.scene-surface:is([data-mode="erase"],[data-shared-erase]) .scene-ink .scene-ink-hit { pointer-events:stroke; }
.scene-ink.erasing :is(polyline,.scene-ink-hit) { pointer-events:none; }
.scene-gesture { pointer-events: none; position: absolute; inset: 0; overflow: visible; }
.scene-text { font-size: 21px; line-height: 1.38; }
.canvas-text,.scene-edit { width: 100%; height: 100%; padding: 5px 6px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.scene-edit { border: 1px solid #767b84; background: white; resize: none; font: inherit; color: var(--ink); }
.scene-selected { outline: 1.5px solid #666b73; z-index: 1; }
.scene-resize { position: absolute; right: -5px; bottom: -5px; width: 12px; height: 12px; border: 1.5px solid #666b73; border-radius: 3px; background: #fff; cursor: nwse-resize; }
.scene-graphic,.scene-legacy { overflow: visible; }
.scene-graphic > .chart,.scene-legacy > .canvas-block { margin: 0; max-height: 100%; overflow: auto; }
.canvas-thumb-button {
  display: flex; align-items: center; gap: 7px; width: 100%; border: 0;
  background: transparent; border-radius: 7px; text-align: left; padding: 5px 4px;
}
.canvas-thumb-button.on { background: #e7eef9; color: #185086; }
.canvas-thumb { display: block; width: 92px; height: 52px; position: relative; overflow: hidden; background: #fff; border: 1px solid #dbe3ed; border-radius: 4px; flex: none; }
.canvas-thumb img { width: 100%; height: 100%; object-fit: contain; }
.canvas-thumb-mini { transform-origin: 0 0; position: absolute; }
.canvas-thumb-mini .scene-item { overflow: hidden; }
.canvas-thumb-button > span:last-child { min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-thumb-button small { display: block; font-size: 10px; color: #596b83; }
.paragraph-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.research-tools { display: flex; gap: 4px; align-items: center; }
.research-tools .icon-button { min-width: 27px; min-height: 26px; padding: 3px; }
.research-tools .ui-icon { width: 15px; height: 15px; }
.research-tools [aria-pressed="true"] { color: #154e8a; background: #e5effb; }
.proposal-status { display: block; color: #985624; }
.version-preview > .scene-scroll { max-height: min(42vh,370px); border-radius: 8px; }
.board-rescue { margin: 5px auto 4px 8px; }
.board-archive { min-height: 28px; padding: 4px 6px; font-size: 11px; white-space: nowrap; }
.canvas-sort-row { position: relative; display: flex; align-items: center; border-radius: 7px; }
.canvas-sort-row.on { background: #eaebee; }
.canvas-sort-row.is-sorting { opacity: .48; }
.canvas-sort-row[data-drop]::after { content: ""; position: absolute; left: 4px; right: 3px; height: 2px; background: #3474bb; border-radius: 4px; pointer-events: none; }
.canvas-sort-row[data-drop="before"]::after { top: -1px; }
.canvas-sort-row[data-drop="after"]::after { bottom: -1px; }
.canvas-sort-row .canvas-thumb-button { flex: 1; min-width: 0; justify-content: flex-start; }
.canvas-sort-row .canvas-thumb { width: 60px; height: 43px; }
.canvas-sort-handle { flex: none; min-width: 25px; min-height: 33px; padding: 3px; border: 0; background: transparent; color: #627896; cursor: grab; touch-action: none; }
.canvas-sort-handle:active:not(:disabled) { cursor: grabbing; }
.canvas-sort-handle:disabled { cursor: default; }
.canvas-sort-row .canvas-rename-handle { flex: none; min-width: 27px; min-height: 33px; padding: 3px; color: #627896; }
.canvas-sort-row .canvas-rename-handle.danger-icon:hover { color: var(--danger); }
.canvas-sort-row:has([data-act=moveCanvasTag]) .canvas-thumb { width: 44px; }
.canvas-rename-handle .ui-icon { width: 15px; height: 15px; }
.canvas-sort-handle .ui-icon { width: 15px; height: 15px; }
.paper-head-actions, .paper-zoom { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.paper-head-actions { justify-content: flex-end; margin-left: auto; }
.paper-zoom { padding-left: 5px; border-left: 1px solid var(--line); }
.paper-zoom:first-child { border: 0; padding: 0; }
.paper-zoom button[aria-pressed="true"] { background: #e8eff9; color: #19538d; }
.paper-viewport { width: 100%; max-height: 65dvh; overflow: auto; scrollbar-width: thin; }
.paper-visual { width: min(100%,880px); min-width: 1px; margin-inline: auto; }
.paper-native-text { font: 400 17px/1.65 Georgia, "Noto Serif CJK SC", serif; color: #232c38; padding: 3px 8px 6px; overflow-wrap: anywhere; }
.paper-viewport.is-magnified { overscroll-behavior: contain; }
.new-workspace .original-art .paper-visual > :is(img,svg) { display: block; width: 100%; height: 100%; max-width: none; margin: 0; }
@container (min-width: 770px) {
  .canvas-toolbar { gap: 4px; }
  .canvas-tools { gap: 1px; padding-right: 4px; }
  .canvas-tool.icon-button { min-width: 25px; padding: 3px; }
  .canvas-toolbar .bindings-tools .tool { padding-inline: 4px; }
}
@container (max-width: 600px) {
  .canvas-toolbar > :first-child { order: -2; }
  .canvas-toolbar-last { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace.new-workspace, .new-workspace aside.left, .new-workspace aside.right, .chat-switch-indicator { transition: none; }
}
@media (max-width: 810px) {
  .canvas-toolbar { gap: 3px 4px; padding: 4px; }
  .canvas-tools { padding-right: 3px; }
  .canvas-tool.icon-button { min-width: 30px; min-height: 31px; }
  .paragraph-controls .site-select { max-width: 90px; }
}

/* Room navigation, projected layout and imported canvas content */
.roomtop-start { display: flex; align-items: center; gap: clamp(6px,1vw,13px); min-width: 0; }
.roomtop-start .room-rails { margin: 0; }
.roomtop-start .room-title { flex: 0 1 auto; }
.roomtop .work-switch {
  position: static; transform: none; width: max-content; max-width: 100%;
  min-width: 0; justify-self: center; z-index: auto;
  margin-block: 1px;
}
.roomtop .work-tabs { max-width: 100%; }
.roomtop .work-tabs-open { padding-inline-start: 6px; }
.roomtop .paper-tab { max-width: clamp(105px,13vw,190px); }
.roomtop .room-actions { justify-self: end; }
.roomtop .presentation-actions { justify-content: flex-end; }
.new-workspace .work-stage { padding-top: 12px; }
.new-workspace .work-stage:has(> .work-empty) { padding-top: 0; }
.new-workspace .rail-heading { justify-content: space-between; }
.new-workspace .rail-heading .history-tools { margin-left: auto; }
.scene-surface,.board-zero {
  background-color: #fafbfc;
  background-image: radial-gradient(circle at center,#c3ccd9 .8px,transparent 1px);
  background-size: 17px 17px;
}
.scene-image img { border-radius: 2px; }
.scene-scroll.can-drop,.board-zero.can-drop { background-color: #dfeafa; box-shadow: inset 0 0 0 2px #5089c6; }
.answer-actions { display: flex; align-items: center; margin: 5px 0 0; }
.answer-actions .answer-to-canvas { min-width: 31px; min-height: 31px; padding: 5px; color: #626b79; }
.answer-actions .answer-to-canvas .ui-icon { width: 17px; height: 17px; pointer-events: none; }
.answer-actions .answer-to-canvas:hover { background: #e8eaee; color: #30343c; }
.answer-actions .answer-to-canvas:active { cursor: grabbing; }
.answer-images { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0; }
.answer-image { display: inline-flex; align-items: center; gap: 4px; color: #2a547d; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 11px; cursor: grab; }
.answer-image .ui-icon { width: 13px; height: 13px; }
.message-attachment img[draggable=true] { cursor: grab; }
.web-inline-cite { color: #124f98; text-decoration: underline; text-underline-offset: 3px; }
.model-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px 10px; }
.model-fields label { min-width: 0; }
.model-fields .site-select > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 811px) {
  .roomtop { display: grid; grid-template-columns: minmax(166px,1fr) minmax(0,min(48vw,660px)) minmax(166px,1fr); gap: 12px; }
}
@media (max-width: 810px) {
  .roomtop-start { display: contents; }
  .roomtop .room-title { grid-row: 1; grid-column: 1/4; }
  .roomtop .room-actions { grid-row: 1; grid-column: 4/-1; }
  .roomtop .room-rails { grid-row: 2; grid-column: 1/3; }
  .roomtop .work-switch { grid-row: 2; grid-column: 3/-1; }
  .roomtop .work-tabs-open { padding-inline-start: 4px; }
  .roomtop .paper-tab { max-width: 155px; }
  .roomtop:has(.translation-trigger:not([hidden])) { grid-template-columns: minmax(66px,auto) minmax(0,1fr) auto; }
  .roomtop:has(.translation-trigger:not([hidden])) .room-title { grid-column: 1/3; }
  .roomtop:has(.translation-trigger:not([hidden])) .room-actions { grid-column: 3; }
  .roomtop:has(.translation-trigger:not([hidden])) .room-rails { grid-column: 1; }
  .roomtop:has(.translation-trigger:not([hidden])) .work-switch { grid-column: 2/4; }
}
@media (max-width: 420px) {
  .roomtop:has(.translation-trigger:not([hidden])) .presentation-actions .icon-button { min-width: 30px; padding-inline: 4px; }
}

html:has(.roomtop), body:has(.roomtop), .new-workspace .reading { overscroll-behavior-x: none; }
.new-workspace .reading { touch-action: pan-y pinch-zoom; }

.fixed-dialog[open] { display:flex; flex-direction:column; padding:0; overflow:hidden; }
.fixed-dialog > .dialog-heading { flex:none; margin:0; padding:15px 21px; border-bottom:1px solid var(--line); }
.fixed-dialog > form { display:flex; flex-direction:column; min-height:0; }
.dialog-scroll { overflow:auto; padding:12px 21px; scrollbar-width:thin; overscroll-behavior:contain; }
.dialog-footer { flex:none; padding:10px 21px 15px; border-top:1px solid var(--line); }
.dialog-footer .error:empty { display:none; }
.dialog-footer .error:not(:empty) { margin:0 0 7px; }
.batch-template { display:inline-flex; align-items:center; gap:6px; padding:7px 9px; color:#18528b; background:#edf4fc; border-radius:8px; text-decoration:none; }
.canvas-side-actions { display:flex; align-items:center; gap:2px; }
.tag-group { margin:5px 0 5px 10px; }
.canvas-tag-head { display:flex; align-items:center; justify-content:flex-start; gap:1px; min-width:0; }
.canvas-tag-head .tag-fold { flex:1; min-width:0; }
.tag-fold span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.canvas-tag-head .tag-action { flex:none; width:26px; min-width:26px; min-height:28px; padding:2px; }
.tag-action .ui-icon { width:15px; height:15px; }
.tag-group .canvas-group-pages { margin-left:11px; padding-left:4px; border-left:1px solid var(--line); }
.tag-group .canvas-thumb { width:55px; }
.new-workspace .reader-stack[data-collapsed="upper"] { grid-template-rows:44px 14px minmax(0,1fr); }
.new-workspace .reader-stack[data-collapsed="lower"] { grid-template-rows:minmax(0,1fr) 14px 44px; }
.reader-stack[data-collapsed="upper"] .original-pane,
.reader-stack[data-collapsed="lower"] .explanation-pane { padding-block:0; overflow:hidden; }
.reader-stack[data-collapsed="upper"] .original-pane > :not(.split-title),
.reader-stack[data-collapsed="lower"] .explanation-pane > :not(.split-title) { display:none; }
.split-title:not([hidden]) { height:100%; display:flex; align-items:center; padding-inline:13px; border:1px solid var(--line); border-radius:11px; background:var(--white); }
.split-title h3 { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shared-ink-tools { display:flex; align-items:center; gap:3px; flex:none; }
.document-panel .shared-ink-tools { padding:3px 10px; border-bottom:1px solid var(--line); }
.shared-ink-tools [aria-pressed="true"] { color:#19538d; background:#e8eff9; }
.canvas-annotation { position:absolute; overflow:hidden; pointer-events:none; }
.canvas-annotation.active { pointer-events:auto; touch-action:none; cursor:crosshair; }
.canvas-annotation { z-index: 2; }
.canvas-annotation .strokes polyline { pointer-events:visibleStroke; }
.canvas-annotation:not(.active) .strokes polyline { pointer-events:none; }
.roomtop :is(button,a):focus-visible,
.new-workspace :is(button,a,[tabindex],input,textarea):focus-visible {
  outline: 2px solid #606774;
  outline-offset: 2px;
}
.new-workspace :is(.scene-scroll,.paper-viewport,.reader-divider,.scene-edit):focus-visible { outline-offset: -2px; }
.roomtop .work-tabs button:focus-visible { outline-offset: -2px; }
.roomtop button,.new-workspace :is(button,.reader-divider,.scene-surface) { -webkit-tap-highlight-color: transparent; }
[data-shared-ink] :is(.drawing,.pointers,.ink-caption) { pointer-events:none; }
[data-stroke].erasing,.scene-ink.erasing { opacity:0; pointer-events:none; }
.scene-surface.viewer-pan { cursor:grab; touch-action:none; }
.scene-surface.viewer-pan[data-dragging] { cursor:grabbing; }
.ink-caption { font-size:12px; font-weight:700; stroke:white; stroke-width:3; paint-order:stroke fill; stroke-linejoin:round; pointer-events:none; }
.new-workspace .strokes .ink-hit { pointer-events:none; }
.new-workspace .erasing-tool .strokes .ink-hit { pointer-events:stroke; }

.canvas-tools .board-clear { min-height:28px; padding:3px 6px; font-size:11px; white-space:nowrap; }
