:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f6;
  color: #17202a;
  --capture-aspect: 1920 / 1080;
  --capture-ratio: 1.7777777778;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.toast {
  position: fixed;
  top: 58px;
  right: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(142, 154, 170, 0.55);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  color: #17202a;
  box-shadow: 0 10px 28px rgba(6, 18, 32, 0.22);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.accessOverlayOpen > main {
  filter: blur(8px);
  pointer-events: none;
  transform: scale(0.995);
  transition: filter 160ms ease, transform 160ms ease;
  user-select: none;
}

.accessOverlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.accessOverlay[hidden] {
  display: none;
}

.accessDialog {
  display: grid;
  justify-items: center;
  width: min(360px, 100%);
  padding: 26px 24px 22px;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: #17202a;
  box-shadow: 0 24px 70px rgba(5, 12, 24, 0.34);
  text-align: center;
}

.accessDialogMark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #fff1f2;
  color: #b42318;
  font-size: 22px;
  font-weight: 900;
}

.accessDialog h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.accessDialog p {
  width: 100%;
  margin: 10px 0 18px;
  color: #5c6b7a;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.accessDialogButton {
  min-width: 116px;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #145ea8;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.accessDialogButton:hover,
.accessDialogButton:focus {
  background: #0f4f8d;
  outline: none;
}

.srOnly {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.clipboardBuffer {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mobileKeyboardInput {
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  z-index: 95;
  display: none;
  width: calc(100vw - 24px);
  max-width: calc(100vw - 24px);
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(41, 113, 165, 0.45);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  color: #17202a;
  box-shadow: 0 10px 26px rgba(6, 18, 32, 0.24);
  font-size: 15px;
  line-height: 22px;
  opacity: 0;
  outline: none;
  pointer-events: none;
  resize: none;
  transform: translateY(16px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.mobileKeyboardInput.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.contextMenu {
  position: fixed;
  z-index: 35;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid rgba(142, 154, 170, 0.58);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 12px 30px rgba(6, 18, 32, 0.28);
}

.contextMenu[hidden] {
  display: none;
}

.contextMenu button {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: #17202a;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.contextMenu button:hover,
.contextMenu button:focus {
  background: #e7edf4;
  filter: none;
}

.bottomDock {
  position: fixed;
  right: 16px;
  bottom: 0;
  left: 16px;
  z-index: 20;
  display: grid;
  grid-template-rows: 42px auto;
  max-height: min(54vh, 460px);
  color: #17202a;
  transform: translateY(calc(100% - 42px));
  transition: transform 180ms ease;
}

.bottomDock:hover,
.bottomDock:focus-within,
.bottomDock.open {
  transform: translateY(0);
}

.dockHandle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 6px 14px;
  border: 1px solid rgba(142, 154, 170, 0.5);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 -6px 24px rgba(6, 18, 32, 0.18);
  backdrop-filter: blur(10px);
}

.dockSummary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 12px;
  color: #5c6b7a;
}

.dockSummary span:first-child {
  flex: 0 0 auto;
  color: #17202a;
  font-weight: 800;
}

.dockSummary span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dockContent {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(300px, 1.2fr) minmax(420px, 1.7fr) minmax(300px, 1.25fr) minmax(300px, 1.25fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(142, 154, 170, 0.5);
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 -8px 28px rgba(6, 18, 32, 0.22);
  overflow: auto;
  backdrop-filter: blur(10px);
}

.liveDockContent {
  grid-template-columns: minmax(190px, 0.7fr) minmax(300px, 1.2fr) minmax(300px, 1.25fr) minmax(300px, 1.25fr);
}

.modeShell,
.aiShell {
  min-height: 100vh;
  padding: 42px 28px;
  background: #eef2f6;
}

.modeShell {
  display: grid;
  align-content: center;
}

.modeHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto 22px;
}

.modeHeader h1 {
  font-size: 30px;
  line-height: 1.1;
}

.modeHeader p {
  margin-top: 10px;
  color: #5c6b7a;
  font-size: 15px;
}

.modeGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}

.modeOption,
.modeBackLink,
.toolbarLink {
  text-decoration: none;
}

.modeOption {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 176px;
  padding: 24px;
  border: 1px solid #d6e0eb;
  border-radius: 8px;
  background: #fff;
  color: #17202a;
  box-shadow: 0 14px 32px rgba(33, 51, 72, 0.09);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.modeOption:hover,
.modeOption:focus {
  border-color: #1b75bc;
  box-shadow: 0 18px 38px rgba(33, 51, 72, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.modeOptionTitle {
  font-size: 24px;
  font-weight: 850;
}

.modeOptionText {
  color: #5c6b7a;
  font-size: 15px;
  line-height: 1.55;
}

.modeOption::after {
  content: "进入";
  justify-self: start;
  padding: 8px 14px;
  border-radius: 6px;
  background: #145ea8;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.modeBackLink,
.toolbarLink {
  flex: 0 0 auto;
  color: #145ea8;
  font-size: 12px;
  font-weight: 800;
}

.aiSearchLayout {
  display: grid;
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 0.62fr);
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.aiBookSearchPanel {
  align-self: start;
}

.aiResultsPanel {
  min-height: calc(100vh - 118px);
}

.aiBookSearchJobs {
  max-height: none;
}

.aiWorkbenchShell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
}

.aiWorkbenchShell .modeHeader {
  width: min(1280px, 100%);
  max-width: none;
}

.aiWorkbench {
  display: grid;
  grid-template-columns: minmax(310px, 340px) minmax(0, 1fr);
  gap: 14px;
  width: min(1280px, 100%);
  min-height: 0;
  margin: 0 auto;
}

.aiTaskSidebar,
.aiTaskWorkspace {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.aiTaskSidebar {
  align-self: start;
  gap: 14px;
}

.aiTaskWorkspace {
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
}

.aiTaskGrid {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.aiActiveTaskPanel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.aiActiveTaskPanel h2 {
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.aiActiveTaskPanel p,
.panelSubMeta {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.aiNewTaskPanel,
.aiHistoryPanel,
.aiTaskListPanel,
.aiResultsPanel {
  min-width: 0;
}

.aiHistoryPanel,
.aiTaskListPanel,
.aiResultsPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.bookTaskHistory,
.bookTaskList,
.aiBookResultList {
  min-height: 0;
  overflow: auto;
}

.bookTaskHistory,
.bookTaskList {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-top: 12px;
}

.bookTaskHistory {
  max-height: calc(100vh - 440px);
}

.bookTaskCard,
.bookQueryItem {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 12px;
  border: 1px solid #e0e7f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #17202a;
  text-align: left;
  filter: none;
}

.bookTaskCard {
  min-height: 96px;
  gap: 2px;
}

.bookTaskCard:hover,
.bookTaskCard:focus,
.bookQueryItem:hover,
.bookQueryItem:focus {
  border-color: #1b75bc;
  background: #f0f7ff;
  outline: none;
}

.bookTaskCard.active,
.bookQueryItem.active {
  border-color: #145ea8;
  background: #edf6ff;
  box-shadow: 0 0 0 2px rgba(27, 117, 188, 0.1);
}

.bookTaskCardTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.bookTaskCard strong,
.bookQueryItem strong {
  min-width: 0;
  color: #17202a;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bookTaskCardMeta,
.bookTaskCardTime,
.bookQueryItem span {
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.bookTaskCardTime {
  margin-top: 6px;
}

.bookTaskBadge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #dce4ed;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.bookTaskBadge.running {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.bookTaskBadge.waiting {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.bookTaskBadge.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.bookTaskBadge.failed {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.bookTaskBadge.idle {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.bookQueryItem {
  position: relative;
  gap: 2px;
}

.bookQueryState {
  color: #475569;
  font-weight: 700;
}

.bookWorkbenchEmpty {
  padding: 18px 12px;
  border: 1px dashed #cbd6e2;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.aiBookResultList {
  margin-top: 10px;
  padding-right: 4px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.2;
}

h2 {
  font-size: 14px;
}

.status,
.toolbar,
.downloads li {
  color: #5c6b7a;
  font-size: 12px;
}

.panel {
  padding: 12px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
  min-height: 0;
}

input,
textarea {
  width: 100%;
  padding: 0 10px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  outline: none;
}

textarea {
  min-height: 92px;
  margin-top: 12px;
  padding-top: 9px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #1b75bc;
  box-shadow: 0 0 0 3px rgba(27, 117, 188, 0.14);
}

button {
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: #146c43;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.96);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary {
  background: #334155;
}

button.danger {
  background: #9f1239;
}

.iconButton {
  width: 32px;
  height: 32px;
  background: #e7edf4;
  color: #17202a;
}

.browserActionsWrap {
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
  overflow: hidden;
}

.browserActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.browserActions button {
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookSearchPanel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.bookSearchInput {
  min-height: 82px;
  margin-top: 0;
  resize: vertical;
}

.bookSearchFile {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bookSearchTips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #5c6b7a;
  font-size: 11px;
}

.bookSearchTips span {
  padding: 4px 7px;
  border: 1px solid #dce4ed;
  border-radius: 6px;
  background: #f8fafc;
}

.bookSearchActions,
.bookSearchPager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bookSearchActions button,
.bookSearchPager button {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.bookSearchJobs {
  display: grid;
  gap: 12px;
  min-height: 0;
  max-height: 310px;
  overflow: auto;
}

.bookSearchJob {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.bookSearchJob:first-child {
  padding-top: 0;
  border-top: 0;
}

.bookSearchJobHeader {
  display: grid;
  gap: 3px;
}

.bookSearchJobHeader strong {
  color: #17202a;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bookSearchJobHeader span,
.bookResultMeta,
.bookResultSource,
.bookSearchEmpty,
.bookSearchError {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.bookSearchError {
  color: #9f1239;
  font-weight: 700;
}

.bookResultList {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
}

.bookResult {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid #eef2f7;
}

.bookResult:first-child {
  border-top: 0;
}

.bookResultCover {
  width: 48px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid #dce4ed;
  border-radius: 4px;
  background: #eef2f6;
}

.bookResultCover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookResultContent {
  min-width: 0;
}

.bookResultTitle {
  display: block;
  color: #145ea8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.bookResultTitle:hover {
  text-decoration: none;
}

.bookResultAuthor {
  margin-top: 2px;
  color: #17202a;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bookResultMeta,
.bookResultSource {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.bookSearchPager {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.bookSearchPager span {
  margin-right: auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.panelTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.panelTitleActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

.panelTitleActions .panelMeta {
  white-space: nowrap;
}

.panelMeta {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.productName {
  color: #e7edf4;
  font-weight: 800;
}

.downloads ul,
.windows ul,
.history ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
  max-height: 260px;
  overflow: auto;
}

.downloads a {
  display: block;
  color: #145ea8;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.emptyItem {
  color: #64748b;
  font-size: 12px;
}

.historyItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.historyItem button {
  height: auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #145ea8;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historyItem button:hover {
  filter: none;
  text-decoration: underline;
}

.historyItem span {
  color: #64748b;
  font-size: 11px;
}

.downloads.downloadFlash {
  animation: downloadBorderFlash 420ms ease-in-out 3;
}

@keyframes downloadBorderFlash {
  0%,
  100% {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
  }

  50% {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  }
}

.windowItem {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dce4ed;
  border-radius: 6px;
  background: #f8fafc;
}

.windowItem.active {
  border-color: #1b75bc;
  background: #edf6ff;
}

.windowTitle {
  color: #17202a;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.windowUrl {
  color: #5c6b7a;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.windowActions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.windowActions button {
  height: 30px;
  font-size: 12px;
}

.viewer {
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-width: 0;
  background: #1c2430;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #d5dde7;
}

.productName,
#connectionStatus,
#controlHint {
  flex: 0 0 auto;
}

#networkStats {
  flex: 0 0 auto;
  color: #aebdcc;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#accessExpiry {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accessExpiry.warning {
  color: #facc15;
}

#accessExpiry.expired {
  color: #f87171;
}

.screenSurface {
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: min(100vw, calc((100vh - 44px) * var(--capture-ratio)));
  max-height: calc(100vh - 44px);
  aspect-ratio: var(--capture-aspect);
  background: #0c1118;
  outline: none;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.screenSurface:focus {
  box-shadow: inset 0 0 0 2px rgba(80, 160, 220, 0.85);
}

video,
#remoteFrame {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0c1118;
}

#remoteFrame[hidden],
video[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .modeShell,
  .aiShell {
    padding: 16px;
  }

  .modeHeader {
    display: grid;
    gap: 10px;
  }

  .modeGrid,
  .aiSearchLayout {
    grid-template-columns: 1fr;
  }

  .aiWorkbench {
    grid-template-columns: 1fr;
  }

  .aiTaskGrid {
    grid-template-columns: 1fr;
  }

  .aiActiveTaskPanel {
    align-items: flex-start;
  }

  .bookTaskHistory {
    max-height: 260px;
  }

  .aiResultsPanel {
    min-height: 420px;
  }

  .mobileKeyboardInput {
    display: block;
  }

  .viewer {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px 8px;
    min-height: 52px;
    height: auto;
    padding: 6px 10px;
    align-items: center;
  }

  .productName {
    grid-column: 1;
    grid-row: 1;
  }

  #connectionStatus {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #networkStats {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    font-size: 11px;
  }

  #controlHint {
    grid-column: 1 / 3;
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    color: #aebdcc;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #accessExpiry {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    max-width: 160px;
    margin-left: 0;
    font-size: 11px;
  }

  .toolbarLink {
    grid-column: 1 / 4;
    grid-row: 3;
    justify-self: start;
  }

  .toast {
    top: 64px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .bottomDock {
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: var(--dock-left, 0px);
    z-index: 80;
    width: var(--dock-width, 100%);
    max-width: 100%;
    max-height: min(62vh, 520px);
    pointer-events: none;
    transform: translateY(calc(100% - 48px));
  }

  .bottomDock:hover,
  .bottomDock:focus-within,
  .bottomDock.open {
    transform: translateY(0);
  }

  .dockContent {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    max-height: calc(min(62vh, 520px) - 48px);
    padding: 10px;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: auto;
  }

  .dockHandle {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 8px 10px 8px 14px;
    border-radius: 12px 12px 0 0;
    pointer-events: auto;
  }

  .iconButton {
    width: 38px;
    height: 38px;
  }

  .screenSurface {
    align-self: start;
    width: 100%;
    max-height: calc(100vh - 52px);
  }

  .panel {
    padding: 10px;
    min-width: 0;
    max-width: 100%;
  }

  .downloads ul,
  .windows ul,
  .history ul {
    max-height: 180px;
  }
}

@media (max-width: 480px) {
  .aiWorkbenchShell .modeHeader,
  .aiActiveTaskPanel,
  .panelTitle {
    align-items: flex-start;
  }

  .aiActiveTaskPanel,
  .panelTitle {
    display: grid;
  }

  .bookSearchActions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bookSearchActions button,
  .bookSearchPager button {
    width: 100%;
  }

  .bookSearchPager {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .bookSearchPager span {
    margin-right: 0;
  }

  .bookSearchPanel > .panelTitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-template-columns: none;
  }

  .bookSearchPanel > .panelTitle h2 {
    min-width: 0;
  }

  .bookSearchPanel > .panelTitle .panelTitleActions {
    flex: 0 0 auto;
  }

  .toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #networkStats {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  #accessExpiry {
    grid-column: 2;
    grid-row: 3;
    max-width: none;
  }

  #controlHint {
    grid-column: 1 / 3;
  }

  .toolbarLink {
    grid-column: 1 / 3;
    grid-row: 4;
  }

  .screenSurface {
    max-height: calc(100vh - 67px);
  }

  .dockSummary {
    gap: 8px;
  }

  .browserActions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browserActions button {
    height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }
}

@media (max-width: 340px) {
  .browserActions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) and (min-width: 861px) {
  .bottomDock {
    max-height: min(66vh, 560px);
  }

  .dockContent {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

.bookFinderShell {
  min-height: 100vh;
  background: #eaf0f6;
}

.bookFinderHeader {
  align-items: center;
  justify-content: flex-end;
}

.bookFinderHeaderActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.bookFinderWorkbench {
  align-items: start;
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
}

.bookFinderSidebar {
  position: sticky;
  top: 16px;
}

.bookFinderGrid {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}

.bookFieldLabel {
  display: block;
  margin: 10px 0 6px;
  color: #17202a;
  font-size: 13px;
  font-weight: 850;
}

.bookUploadBox {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #f8fafc;
}

.bookUploadBox span {
  min-width: 0;
  color: #475569;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghostButton {
  border: 1px solid #cbd6e2;
  background: #fff;
  color: #334155;
}

.bookHelperText,
.panelSubMeta {
  margin: 0;
  color: #52677f;
  font-size: 12px;
  line-height: 1.5;
}

.bookExtractProgress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #f8fafc;
}

.bookExtractProgress[hidden] {
  display: none;
}

.bookExtractProgressTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bookExtractProgressTop strong {
  color: #17202a;
  font-size: 12px;
}

.bookExtractProgressTop span {
  color: #145ea8;
  font-size: 12px;
  font-weight: 850;
}

.bookExtractBar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce4ed;
}

.bookExtractBar span {
  display: block;
  width: var(--extract-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: #2f8f66;
  transition: width 180ms ease;
}

.bookExtractResult {
  color: #52677f;
  font-size: 12px;
  line-height: 1.45;
}

.bookExtractResult.error {
  color: #be123c;
  font-weight: 700;
}

.bookFormatSelect {
  position: relative;
  z-index: 30;
}

.bookFormatButton {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd6e2;
  border-radius: 8px;
  background: #fff;
  color: #17202a;
  text-align: left;
}

.bookFormatButton strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookFormatButton span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
}

.bookFormatMenu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 10;
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(33, 51, 72, 0.18);
}

.bookFormatMenu[hidden] {
  display: none;
}

.bookFormatOptions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
}

.bookFormatOption {
  height: 34px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #f8fafc;
  color: #17202a;
  font-weight: 850;
}

.bookFormatOption.active {
  border-color: #1b75bc;
  background: #edf6ff;
  color: #145ea8;
}

.bookFinderResult {
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.bookResultCoverStack {
  display: grid;
  gap: 8px;
  align-content: start;
}

.bookFinderResult .bookResultCover {
  width: 86px;
  justify-self: center;
}

.bookFinderResult .bookResultTitle {
  font-size: 14px;
  line-height: 1.45;
}

.bookFinderResult .bookResultMeta,
.bookFinderResult .bookResultSource,
.bookResultFormat {
  font-size: 12px;
  line-height: 1.5;
}

.bookResultFormat {
  margin-top: 6px;
  color: #17202a;
  font-weight: 850;
}

.formatCompact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.formatCompact button {
  min-height: 38px;
  width: 100%;
  padding: 0 8px;
  font-size: 13px;
}

.bookDownloadPanel {
  margin-top: 16px;
}

.bookDownloadHistory {
  display: grid;
  gap: 10px;
}

.bookDownloadItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #f8fafc;
}

.bookDownloadItem h3 {
  margin: 0 0 4px;
  color: #17202a;
  font-size: 15px;
}

.bookDownloadProgressBox {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.bookDownloadProgress {
  overflow: hidden;
  width: min(360px, 100%);
  height: 7px;
  border-radius: 999px;
  background: #dce7f2;
}

.bookDownloadProgress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #178055;
  transition: width 180ms ease;
}

.bookDownloadProgressBox small {
  color: #49617d;
  font-size: 12px;
}

.bookDownloadAction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  background: #1b75bc;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.bookDownloadAction[aria-disabled="true"] {
  background: #dce4ed;
  color: #64748b;
  cursor: not-allowed;
}

@media (max-width: 1180px) {
  .bookFinderResult {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .bookFinderResult .bookResultCover {
    width: 78px;
  }
}

@media (max-width: 980px) {
  .bookFinderWorkbench,
  .bookFinderGrid {
    grid-template-columns: 1fr;
  }

  .bookFinderSidebar {
    position: static;
  }

  .bookDownloadItem {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bookDownloadAction {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .bookFinderHeaderActions {
    width: 100%;
    justify-content: flex-end;
  }

  .bookUploadBox {
    grid-template-columns: 1fr;
  }

  .bookUploadBox button {
    width: 100%;
  }

  .bookFormatOptions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bookFinderResult {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
  }

  .bookFinderResult .bookResultCover {
    width: 72px;
  }

  .recommended {
    padding: 7px;
  }
}

.bookFinderStack {
  display: grid;
  gap: 14px;
}

.bookSearchPanel {
  display: grid;
  gap: 12px;
}

.bookSearchInput {
  min-height: 82px;
}

.bookSearchSecondRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
}

.bookSearchActions {
  display: grid;
}

.bookSearchActions button {
  min-height: 44px;
  background: #147a4b;
}

.bookDownloadDrawerBtn {
  position: relative;
}

.bookDownloadDrawerBtn::after {
  content: attr(data-count);
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #147a4b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.bookTaskPicker {
  position: relative;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
}

.bookTaskPickerButton {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid #d4e0ec;
  border-radius: 8px;
  background: #fff;
  color: #17202a;
  text-align: left;
  box-shadow: 0 1px 0 rgba(33, 51, 72, 0.03);
}

.bookTaskPickerButton strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  line-height: 1.25;
}

.bookTaskPickerButton em {
  display: block;
  color: #52677f;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.bookTaskPickerButton:hover {
  border-color: #9fc4ef;
  background: #f8fbfe;
}

.bookTaskPickerMenu {
  position: absolute;
  top: calc(100% - 8px);
  left: 16px;
  right: 0;
  z-index: 60;
  width: min(560px, calc(100vw - 64px));
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 6px;
  border: 1px solid #d4e0ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(33, 51, 72, 0.18);
}

.bookTaskPickerMenu[hidden] {
  display: none;
}

.bookTaskMenuList,
.bookTaskMenuBooks {
  display: grid;
  gap: 8px;
}

.bookTaskMenuBooks {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}

.bookTaskMenuItem,
.bookTaskMenuBook {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: #17202a;
  text-align: left;
}

.bookTaskMenuItem.active,
.bookTaskMenuBook.active {
  border-color: #b8d8fb;
  background: #f0f7ff;
  box-shadow: none;
}

.bookTaskMenuItem strong,
.bookTaskMenuBook strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookTaskMenuItem span,
.bookTaskMenuBook span {
  grid-column: 1;
  min-width: 0;
  color: #52677f;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookTaskMenuItem em,
.bookTaskMenuBook em {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-style: normal;
}

.bookTaskMenuPager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.bookTaskMenuPager span {
  color: #52677f;
  font-size: 13px;
}

.bookResultHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
}

.bookResultsPanel > .panelTitle {
  border-bottom: 1px solid #edf2f7;
}

.bookFinderResult {
  grid-template-columns: 104px minmax(0, 1fr) 126px;
  align-items: start;
  gap: 18px;
}

.bookFinderResult .bookResultCover {
  width: 96px;
  justify-self: start;
}

.bookResultAction {
  display: flex;
  justify-content: flex-end;
}

.bookResultAction button {
  min-width: 104px;
  min-height: 40px;
  background: #147a4b;
}

.bookDownloadShade {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.26);
}

.bookDownloadDrawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 81;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(520px, 100vw);
  height: 100vh;
  border-left: 1px solid #d6e0eb;
  background: #fff;
  box-shadow: -18px 0 44px rgba(33, 51, 72, 0.18);
}

.bookDownloadShade[hidden],
.bookDownloadDrawer[hidden] {
  display: none;
}

.bookDownloadDrawer .bookDownloadHistory {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.bookDownloadDrawer .bookDownloadItem {
  grid-template-columns: minmax(0, 1fr) auto;
}

.bookDownloadDrawer .bookDownloadAction {
  grid-column: 1 / -1;
  justify-self: start;
}

@media (max-width: 980px) {
  .bookSearchSecondRow,
  .bookFinderResult {
    grid-template-columns: 1fr;
  }

  .bookTaskMenuItem,
  .bookTaskMenuBook {
    grid-template-columns: 1fr;
  }

  .bookResultAction {
    justify-content: stretch;
  }

  .bookResultAction button {
    width: 100%;
  }
}

.bookFinderStack {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
}

.bookSearchPanel,
.bookResultsPanel {
  border-color: #cbd8e6;
  box-shadow: 0 12px 32px rgba(33, 51, 72, 0.1);
}

.bookResultsPanel {
  overflow: visible;
}

.bookSearchPanel > .panelTitle,
.bookResultsPanel > .panelTitle,
.bookDownloadDrawer > .panelTitle {
  padding: 16px 18px;
  background: #fff;
}

.bookSearchPanel > .panelTitle h2,
.bookResultsPanel > .panelTitle h2,
.bookDownloadDrawer > .panelTitle h2,
.bookResultHeader h2 {
  font-size: 20px;
  line-height: 1.2;
}

.bookSearchPanel .bookSearchInput {
  width: calc(100% - 32px);
  min-height: 82px;
  margin: 0 16px;
  border-color: #c7d5e4;
  border-radius: 8px;
  background: #fbfdff;
  font-size: 16px;
  line-height: 1.5;
}

.bookSearchSecondRow {
  margin: 0 16px;
}

.bookSearchPanel .bookUploadBox {
  min-height: 52px;
  margin-top: 0;
  border-color: #c7d5e4;
  background: #fbfdff;
}

.bookSearchPanel .bookUploadBox .secondary {
  background: #334155;
  color: #fff;
}

.bookSearchPanel .bookFormatSelect {
  z-index: 50;
}

.bookSearchPanel .bookFormatButton {
  min-height: 52px;
  height: 52px;
  border-color: #c7d5e4;
  background: #fbfdff;
}

.bookSearchPanel .bookExtractProgress {
  margin: 0 16px;
}

.bookSearchPanel .bookFormatMenu {
  left: auto;
  width: min(360px, calc(100vw - 48px));
}

.bookSearchActions {
  margin: 0 16px 16px;
}

.bookSearchActions button {
  font-size: 16px;
}

.bookTaskPickerButton {
  min-height: 82px;
  border-color: #1b75bc;
  background: #edf6ff;
}

.bookTaskPickerButton em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookTaskPickerMenu {
  border-color: #8ec5ff;
}

.bookTaskMenuItem,
.bookTaskMenuBook {
  min-height: 52px;
  background: #fff;
}

.bookTaskMenuItem:hover,
.bookTaskMenuBook:hover {
  border-color: #9fc4ef;
  background: #f4f9ff;
}

.bookTaskMenuItem.active,
.bookTaskMenuBook.active {
  box-shadow: 0 0 0 2px rgba(27, 117, 188, 0.1);
}

.bookResultHeader {
  border-top: 1px solid #dbe6f2;
  background: #fff;
}

.bookFinderResult {
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}

.bookFinderResult:hover {
  background: #fbfdff;
}

.bookFinderResult .bookResultTitle {
  font-size: 18px;
  line-height: 1.35;
}

.bookFinderResult .bookResultAuthor,
.bookFinderResult .bookResultMeta,
.bookFinderResult .bookResultFormat {
  font-size: 14px;
}

.bookSearchPager {
  padding: 14px 18px;
  border-top: 1px solid #edf2f7;
  background: #fff;
}

.bookFinderStack {
  width: min(1320px, calc(100vw - 32px));
  gap: 16px;
}

.bookSearchPanel,
.bookResultsPanel {
  border-radius: 8px;
}

.bookSearchPanel {
  gap: 14px;
  padding-bottom: 18px;
}

.bookSearchPanel .bookSearchInput {
  min-height: 104px;
  padding: 14px 16px;
  background: #fff;
}

.bookSearchSecondRow {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: stretch;
  gap: 14px;
}

.bookSearchPanel .bookUploadBox,
.bookSearchPanel .bookFormatButton {
  min-height: 58px;
  border-color: #d1deeb;
  background: #f8fbfe;
}

.bookSearchPanel .bookUploadBox {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px;
}

.bookSearchPanel .bookUploadBox .secondary,
.bookSearchPanel .ghostButton {
  min-height: 38px;
}

.bookSearchPanel .bookUploadBox span {
  font-size: 13px;
}

.bookSearchPanel .bookFormatButton {
  height: 58px;
  padding: 0 14px;
}

.bookSearchPanel .bookFormatButton strong {
  min-width: 0;
  overflow: hidden;
  color: #17202a;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookSearchPanel .bookFormatButton span {
  color: #52677f;
  font-size: 12px;
  font-weight: 800;
}

.bookSearchActions button {
  min-height: 46px;
  border-radius: 8px;
}

.bookTaskPickerMenu {
  right: auto;
  width: min(820px, calc(100vw - 48px));
  padding: 10px;
}

.bookTaskMenuList,
.bookTaskMenuBooks {
  gap: 6px;
}

.bookTaskMenuBooks {
  margin-top: 8px;
  padding-top: 8px;
}

.bookTaskMenuItem,
.bookTaskMenuBook {
  grid-template-columns: minmax(150px, 230px) minmax(240px, 1fr) auto;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 7px;
}

.bookTaskMenuItem strong,
.bookTaskMenuBook strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookTaskMenuItem span,
.bookTaskMenuBook span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookTaskMenuItem .bookTaskBadge,
.bookTaskMenuBook .bookTaskBadge {
  min-width: 64px;
}

.bookDownloadDrawer {
  width: min(560px, 100vw);
}

.bookDownloadDrawer .panelTitle {
  align-items: center;
}

.bookDownloadDrawer .bookDownloadHistory {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.bookDownloadDrawer .bookDownloadItem {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "body badge"
    "action action";
  align-items: start;
  gap: 10px 12px;
  padding: 14px;
  background: #f8fbfe;
}

.bookDownloadDrawer .bookDownloadItem > div {
  grid-area: body;
  min-width: 0;
}

.bookDownloadDrawer .bookDownloadItem h3 {
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookDownloadDrawer .bookDownloadItem .panelSubMeta {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
}

.bookDownloadDrawer .bookDownloadProgress {
  width: 100%;
}

.bookDownloadDrawer .bookDownloadItem .bookTaskBadge {
  grid-area: badge;
  align-self: start;
}

.bookDownloadDrawer .bookDownloadAction {
  grid-area: action;
  justify-self: start;
  min-height: 34px;
}

@media (max-width: 980px) {
  .bookTaskPickerMenu {
    width: calc(100vw - 48px);
  }

  .bookTaskMenuItem,
  .bookTaskMenuBook {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bookTaskMenuItem span,
  .bookTaskMenuBook span {
    grid-column: 1 / -1;
  }
}

/* Final polish for the compact PC task selector. */
.bookResultsPanel > .panelTitle {
  padding: 16px 18px 10px;
}

.bookTaskPicker {
  margin: 0;
  padding: 12px 16px 14px;
  border-bottom: 1px solid #edf2f7;
  position: relative;
  width: min(560px, 100%);
}

.bookTaskPickerButton {
  width: 100%;
  min-height: 54px;
  padding: 9px 12px;
  border-color: #d3dfeb;
  background: #fff;
  cursor: pointer;
}

.bookTaskPickerButton strong {
  margin-bottom: 2px;
  font-size: 15px;
}

.bookTaskPickerButton em {
  font-size: 12px;
}

.bookTaskPickerMenu {
  position: absolute;
  top: calc(100% - 8px);
  left: 16px;
  right: auto;
  z-index: 70;
  width: calc(100% - 32px);
  max-height: none;
  overflow: visible;
  margin-top: 0;
  padding: 6px;
  border-color: #d3dfeb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(33, 51, 72, 0.18);
}

.bookTaskMenuList {
  gap: 2px;
}

.bookTaskMenuItem,
.bookTaskMenuBook {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  min-height: 48px;
  padding: 8px 10px;
  border-color: transparent;
  background: #fff;
}

.bookTaskMenuItem:hover,
.bookTaskMenuBook:hover {
  background: #f8fbfe;
}

.bookTaskMenuItem span,
.bookTaskMenuBook span {
  grid-column: 1;
}

.bookTaskMenuItem em,
.bookTaskMenuBook em {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

@media (max-width: 760px) {
  .bookSearchSecondRow {
    grid-template-columns: 1fr;
  }

  .bookSearchPanel .bookUploadBox,
  .bookSearchPanel .bookFormatButton {
    min-height: 54px;
  }

  .bookSearchPanel .bookUploadBox {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .bookSearchPanel .bookUploadBox .secondary,
  .bookSearchPanel .ghostButton {
    min-height: 36px;
    padding: 0 10px;
  }

  .bookSearchPanel .bookFormatButton {
    height: 54px;
  }
}

@media (max-width: 340px) {
  .bookSearchPanel .bookUploadBox {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bookSearchPanel .bookUploadBox .ghostButton {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.bookQueryStrip {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #edf2f7;
  overflow-x: auto;
  overflow-y: hidden;
}

.bookQueryStrip .bookWorkbenchEmpty {
  flex: 1 1 auto;
}

.bookQueryStrip .bookQueryItem {
  flex: 0 0 180px;
  min-height: 58px;
  padding: 9px 10px;
  border-color: #dce4ed;
  background: #fff;
}

.bookQueryStrip .bookQueryItem.active {
  border-color: #1b75bc;
  background: #edf6ff;
}

.bookQueryStrip .bookQueryItem.failed {
  border-color: #fecdd3;
}

.bookQueryStrip .bookQueryItem.running {
  border-color: #bfdbfe;
}

.bookQueryStrip .bookQueryItem strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookQueryStrip .bookQueryItem span {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.25;
}

.bookQueryStrip .bookQueryState {
  position: absolute;
  right: 8px;
  bottom: 7px;
  color: #64748b;
}

.bookQueryStrip .bookQueryState.done {
  color: #15803d;
}

.bookQueryStrip .bookQueryState.running {
  color: #1d4ed8;
}

.bookQueryStrip .bookQueryState.failed {
  color: #be123c;
}

.bookSearchActions button:disabled {
  opacity: 0.82;
  filter: none;
}

@media (max-width: 760px) {
  .bookQueryStrip {
    padding: 10px 12px;
  }

  .bookQueryStrip .bookQueryItem {
    flex-basis: 150px;
  }
}

.bookHistorySelectors {
  display: grid;
  grid-template-columns: minmax(260px, 560px) minmax(260px, 1fr);
  gap: 12px;
  padding: 12px 16px 14px;
  border-bottom: 1px solid #edf2f7;
}

.bookHistorySelectors .bookTaskPicker,
.bookQueryPicker {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.bookQueryPickerButton {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid #d3dfeb;
  border-radius: 8px;
  background: #fff;
  color: #17202a;
  text-align: left;
  cursor: pointer;
}

.bookQueryPickerButton:disabled {
  cursor: not-allowed;
}

.bookQueryPickerButton strong {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookQueryPickerButton em {
  display: block;
  overflow: hidden;
  color: #52677f;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookQueryPickerButton:hover {
  border-color: #9fc4ef;
  background: #f8fbfe;
}

.bookHistorySelectors .bookTaskPickerMenu,
.bookQueryPickerMenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 80;
  width: 100%;
  max-height: none;
  overflow: visible;
  margin-top: 0;
  padding: 6px;
  border: 1px solid #d3dfeb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(33, 51, 72, 0.18);
}

.bookQueryPickerMenu[hidden] {
  display: none;
}

.bookQueryPickerMenu .bookTaskList {
  display: grid;
  gap: 2px;
  max-height: min(55vh, 420px);
  margin: 0;
  overflow: auto;
}

.bookQueryPickerMenu .bookQueryItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title state"
    "meta state";
  gap: 2px 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: #17202a;
  text-align: left;
}

.bookQueryPickerMenu .bookQueryItem:hover {
  background: #f8fbfe;
}

.bookQueryPickerMenu .bookQueryItem.active {
  border-color: #b8d8fb;
  background: #f0f7ff;
  box-shadow: none;
}

.bookQueryPickerMenu .bookQueryItem strong {
  grid-area: title;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookQueryPickerMenu .bookQueryItem span {
  grid-area: meta;
  margin-top: 0;
  color: #52677f;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookQueryPickerMenu .bookQueryItem .bookQueryState {
  grid-area: state;
  position: static;
  align-self: center;
  color: #64748b;
  text-align: right;
}

.bookQueryPickerMenu .bookQueryItem .bookQueryState.done {
  color: #15803d;
}

.bookQueryPickerMenu .bookQueryItem .bookQueryState.running {
  color: #1d4ed8;
}

.bookQueryPickerMenu .bookQueryItem .bookQueryState.failed {
  color: #be123c;
}

@media (max-width: 760px) {
  .bookHistorySelectors {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }
}

/* Typography refinement for the book finder page. */
.bookFinderShell {
  font-family:
    Inter,
    "HarmonyOS Sans SC",
    "MiSans",
    "PingFang SC",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bookSearchPanel > .panelTitle h2,
.bookResultsPanel > .panelTitle h2,
.bookDownloadDrawer > .panelTitle h2,
.bookResultHeader h2 {
  font-size: 18px;
  line-height: 1.28;
  letter-spacing: 0;
}

.bookSearchPanel .bookSearchInput {
  min-height: 92px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.55;
}

.bookSearchPanel .bookUploadBox,
.bookSearchPanel .bookFormatButton {
  min-height: 52px;
}

.bookSearchPanel .bookFormatButton {
  height: 52px;
}

.bookSearchPanel .bookFormatButton strong {
  font-size: 16px;
  line-height: 1.2;
}

.bookSearchActions button {
  min-height: 42px;
  font-size: 15px;
  font-weight: 800;
}

.bookDownloadDrawerBtn,
.bookSearchPanel .bookUploadBox .secondary,
.bookSearchPanel .ghostButton {
  font-size: 14px;
  line-height: 1.2;
}

.bookFinderResult {
  padding: 14px 18px;
}

.bookFinderResult .bookResultTitle {
  font-size: 16px;
  line-height: 1.42;
  font-weight: 800;
}

.bookFinderResult .bookResultAuthor,
.bookFinderResult .bookResultMeta,
.bookFinderResult .bookResultFormat {
  font-size: 13px;
  line-height: 1.48;
}

.bookTaskPickerButton strong,
.bookQueryPickerMenu .bookQueryItem strong {
  font-size: 14px;
  line-height: 1.35;
}

.bookTaskPickerButton em,
.bookTaskMenuItem span,
.bookTaskMenuBook span,
.bookQueryPickerMenu .bookQueryItem span,
.panelMeta,
.panelSubMeta {
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .bookFinderStack {
    width: 100%;
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
  }

  .bookSearchPanel,
  .bookResultsPanel {
    max-width: 100%;
    overflow: hidden;
  }

  .bookSearchPanel {
    position: relative;
    z-index: 30;
    overflow: visible;
  }

  .bookResultsPanel {
    position: relative;
    z-index: 1;
  }

  .bookSearchPanel > .panelTitle h2,
  .bookResultsPanel > .panelTitle h2,
  .bookDownloadDrawer > .panelTitle h2,
  .bookResultHeader h2 {
    font-size: 17px;
  }

  .bookSearchPanel .bookSearchInput {
    min-height: 88px;
    font-size: 15px;
  }

  .bookSearchPanel .bookUploadBox {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .bookSearchPanel .bookUploadBox span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bookSearchPanel .bookUploadBox .ghostButton {
    grid-column: 1 / -1;
    justify-self: end;
    min-height: 32px;
  }

  .bookSearchPanel .bookFormatButton {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 12px;
  }

  .bookSearchPanel .bookFormatButton span {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bookFinderResult {
    padding: 12px 14px;
  }

  .bookFinderResult .bookResultTitle {
    font-size: 15px;
  }

  .bookFinderResult .bookResultAuthor,
  .bookFinderResult .bookResultMeta,
  .bookFinderResult .bookResultFormat {
    font-size: 12px;
  }

  .bookSearchPanel .bookFormatSelect {
    position: relative;
    z-index: 90;
  }

  .bookSearchPanel .bookFormatMenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 120;
    width: auto;
    max-height: 240px;
    margin: 0;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.2);
  }

  .bookSearchPanel .bookFormatOptions {
    max-height: 220px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
  }

  .bookSearchPanel .bookFormatOption {
    min-height: 42px;
    font-size: 15px;
  }
}

/* Bottom download dock. Overrides the older right-side drawer presentation. */
.bookFinderShell {
  padding-bottom: 132px;
}

.bookDownloadShade {
  display: none !important;
}

.bookDownloadDrawer {
  position: fixed;
  top: auto;
  right: auto;
  bottom: 18px;
  left: 50%;
  z-index: 80;
  display: block;
  width: min(980px, calc(100vw - 32px));
  height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  pointer-events: none;
}

.bookDownloadDrawer[hidden] {
  display: block;
}

.bookDownloadDrawer.nudge {
  animation: bookDownloadDockNudge 420ms ease-out;
}

.bookDownloadDockBar {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 12px 12px 12px 16px;
  border: 1px solid #add2bc;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 52px rgba(31, 48, 73, 0.18);
  backdrop-filter: blur(10px);
}

.bookDownloadDrawer.open .bookDownloadDockBar {
  border-bottom-color: transparent;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 8px 24px rgba(31, 48, 73, 0.1);
}

.bookDownloadDockMain {
  min-width: 0;
}

.bookDownloadDockMain strong {
  display: block;
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.bookDownloadDockMain span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #58708a;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookDownloadChips {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
}

.bookDownloadChip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d6e1ec;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.bookDownloadChip i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9a5a08;
}

.bookDownloadChip.running i {
  background: #9a5a08;
}

.bookDownloadChip.waiting i {
  background: #94a3b8;
}

.bookDownloadChip.done i {
  background: #13784b;
}

.bookDownloadChip.failed i {
  background: #b42342;
}

.bookDownloadDrawerBtn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  background: #13784b;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.bookDownloadDrawerBtn::after {
  content: none;
}

.bookDownloadDockPanel {
  pointer-events: auto;
  overflow: hidden;
  max-height: 0;
  margin-top: 0;
  border: 1px solid #add2bc;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 52px rgba(31, 48, 73, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 220ms ease, opacity 180ms ease, transform 180ms ease;
}

.bookDownloadDrawer.open .bookDownloadDockPanel {
  overflow-y: auto;
  max-height: min(54vh, 520px);
  opacity: 1;
  transform: translateY(0);
}

.bookDownloadDrawer .bookDownloadHistory {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  overflow: visible;
}

.bookDownloadDrawer .bookDownloadItem {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(240px, 0.9fr) auto;
  grid-template-areas:
    "body progress badge"
    "body progress action";
  gap: 12px 18px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid #d6e1ec;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.bookDownloadDrawer .bookDownloadItem.ready {
  border-color: #8fd9b0;
  background: linear-gradient(90deg, #f3fff8, #ffffff 45%);
}

.bookDownloadDrawer .bookDownloadItem.justReady::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 50% 50%, rgba(31, 197, 110, 0.28), transparent 34%);
  animation: bookDownloadFinishGlow 900ms ease-out both;
  pointer-events: none;
}

.bookDownloadDrawer .bookDownloadItem > div {
  grid-area: body;
  min-width: 0;
}

.bookDownloadDrawer .bookDownloadItem h3 {
  overflow: hidden;
  margin: 0 0 5px;
  color: #111827;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookDownloadDrawer .bookDownloadItem .panelSubMeta {
  color: #58708a;
  font-size: 13px;
  line-height: 1.45;
}

.bookDownloadDrawer .bookDownloadProgress {
  width: 100%;
}

.bookDownloadDrawer .bookDownloadProgress span {
  background: linear-gradient(90deg, #1b77bd, #18a56d);
  transition: width 280ms ease;
}

.bookDownloadDrawer .bookDownloadItem .bookTaskBadge {
  grid-area: badge;
  align-self: end;
  justify-self: end;
}

.bookDownloadDrawer .bookDownloadAction {
  grid-area: action;
  justify-self: end;
  align-self: start;
  min-height: 38px;
  border-radius: 9px;
  font-size: 14px;
}

.bookDownloadDrawer .bookDownloadItem > .bookDownloadProgressArea {
  grid-area: progress;
  min-width: 0;
  margin-top: 0;
}

.bookDownloadReadyToast {
  position: fixed;
  right: 24px;
  bottom: 102px;
  z-index: 100;
  max-width: calc(100vw - 48px);
  padding: 13px 16px;
  border-radius: 12px;
  background: #102033;
  color: #fff;
  box-shadow: 0 18px 52px rgba(31, 48, 73, 0.18);
  font-weight: 800;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.bookDownloadReadyToast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes bookDownloadDockNudge {
  0%,
  100% {
    transform: translateX(-50%);
  }
  18% {
    transform: translateX(calc(-50% - 8px));
  }
  36% {
    transform: translateX(calc(-50% + 8px));
  }
  54% {
    transform: translateX(calc(-50% - 5px));
  }
  72% {
    transform: translateX(calc(-50% + 5px));
  }
}

@keyframes bookDownloadFinishGlow {
  0% {
    opacity: 0;
    transform: scale(0.75);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@media (max-width: 980px) {
  .bookDownloadDrawer .bookDownloadItem {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "body badge"
      "progress progress"
      "action action";
    align-items: start;
  }

  .bookDownloadDrawer .bookDownloadItem .bookTaskBadge {
    align-self: start;
  }

  .bookDownloadDrawer .bookDownloadAction {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .bookFinderShell {
    padding-bottom: 178px;
  }

  .bookDownloadDrawer {
    bottom: 10px;
    width: calc(100vw - 18px);
  }

  .bookDownloadDockBar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 58px;
  }

  .bookDownloadChips {
    grid-column: 1 / -1;
    order: 3;
  }

  .bookDownloadDockMain strong {
    font-size: 16px;
  }

  .bookDownloadDockMain span {
    font-size: 12px;
  }

  .bookDownloadDrawerBtn {
    min-height: 38px;
    padding: 0 12px;
  }

  .bookDownloadDrawer.open .bookDownloadDockPanel {
    max-height: 62vh;
  }

  .bookDownloadDrawer .bookDownloadItem {
    grid-template-columns: 1fr;
    grid-template-areas:
      "body"
      "progress"
      "badge"
      "action";
  }

  .bookDownloadDrawer .bookDownloadItem .bookTaskBadge,
  .bookDownloadDrawer .bookDownloadAction {
    justify-self: start;
  }

  .bookDownloadReadyToast {
    right: 50%;
    bottom: 112px;
    transform: translate(50%, 18px);
  }

  .bookDownloadReadyToast.show {
    transform: translate(50%, 0);
  }
}

.feedbackTopEntry {
  position: relative;
  z-index: 92;
  flex: 0 0 auto;
}

.feedbackEntryButton,
.feedbackPrimary,
.feedbackSecondary {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.panelTitleActions .feedbackEntryButton {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.feedbackEntryButton,
.feedbackPrimary {
  background: #146c43;
  color: #fff;
}

.feedbackEntryButton:hover,
.feedbackPrimary:hover,
.feedbackEntryButton:focus,
.feedbackPrimary:focus {
  background: #0f5b37;
  outline: none;
}

.feedbackPrimary:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.feedbackPrimary.wide {
  width: 100%;
}

.feedbackSecondary {
  border: 1px solid #cbd8e6;
  background: #334155;
  color: #fff;
}

.feedbackQuickMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 148px;
  padding: 6px;
  border: 1px solid #d6e1ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 46px rgba(31, 48, 73, 0.18);
}

.feedbackQuickMenu[hidden] {
  display: none;
}

.feedbackQuickMenu button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #17202a;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.feedbackQuickMenu button:hover,
.feedbackQuickMenu button:focus {
  background: #eef6ff;
  color: #145ea8;
  outline: none;
}

.feedbackModal {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 22px;
}

.feedbackModal[hidden] {
  display: none;
}

.feedbackBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(7px);
}

.feedbackDialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  border: 1px solid #d6e1ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(31, 48, 73, 0.24);
}

.feedbackNoticeDialog {
  width: min(520px, 100%);
  padding: 34px;
}

.feedbackMainDialog {
  padding: 0;
}

.feedbackClose {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #66788f;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.feedbackClose:hover,
.feedbackClose:focus {
  border-color: #d6e1ec;
  background: #f5f8fb;
  outline: none;
}

.feedbackDialog h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.feedbackDialog p {
  margin: 0 0 12px;
  color: #51657d;
  font-size: 14px;
  line-height: 1.65;
}

.feedbackDialogHead {
  padding: 26px 28px 14px;
  border-bottom: 1px solid #e5edf5;
}

.feedbackTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 28px 0;
}

.feedbackTabs button,
.feedbackChoiceGrid button {
  min-height: 42px;
  border: 1px solid #d6e1ec;
  border-radius: 9px;
  background: #f8fafc;
  color: #17202a;
  font-weight: 900;
  cursor: pointer;
}

.feedbackTabs button.active,
.feedbackChoiceGrid button.selected {
  border-color: #1b75bc;
  background: #eef6ff;
  color: #145ea8;
}

.feedbackForm {
  display: grid;
  gap: 14px;
  padding: 18px 28px 28px;
}

.feedbackForm[hidden] {
  display: none !important;
}

.feedbackFormGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feedbackField {
  display: grid;
  gap: 7px;
  color: #17202a;
  font-weight: 900;
}

.feedbackField input,
.feedbackField textarea {
  width: 100%;
  border: 1px solid #cbd8e6;
  border-radius: 9px;
  background: #fff;
  color: #17202a;
  font-size: 15px;
  line-height: 1.45;
  outline: none;
}

.feedbackField input {
  min-height: 44px;
  padding: 0 12px;
}

.feedbackField textarea {
  min-height: 128px;
  padding: 11px 12px;
  resize: vertical;
}

.feedbackField input:focus,
.feedbackField textarea:focus {
  border-color: #1b75bc;
  box-shadow: 0 0 0 3px rgba(27, 117, 188, 0.12);
}

.feedbackChoiceGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.feedbackChoiceGrid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.feedbackUploadRow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid #d6e1ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #51657d;
  font-size: 14px;
}

.feedbackFileList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedbackFileList span {
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #cfe2f5;
  border-radius: 999px;
  background: #eef6ff;
  color: #145ea8;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.feedbackLegalBox {
  padding: 14px;
  border-left: 4px solid #145ea8;
  border-radius: 10px;
  background: #f4f8fc;
}

.feedbackLegalBox strong {
  display: block;
  margin-bottom: 6px;
  color: #111827;
}

.feedbackCheck {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.feedbackCheck input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.feedbackToast {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 180;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 10px;
  background: #102033;
  color: #fff;
  box-shadow: 0 18px 52px rgba(31, 48, 73, 0.22);
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.feedbackToast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .panelTitleActions {
    gap: 8px;
  }

  .feedbackEntryButton {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }

  .feedbackModal {
    align-items: end;
    padding: 0;
  }

  .feedbackDialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
  }

  .feedbackNoticeDialog {
    padding: 30px 22px 22px;
  }

  .feedbackDialogHead,
  .feedbackTabs,
  .feedbackForm {
    padding-left: 16px;
    padding-right: 16px;
  }

  .feedbackDialog h2 {
    font-size: 23px;
  }

  .feedbackFormGrid,
  .feedbackChoiceGrid,
  .feedbackChoiceGrid.compact {
    grid-template-columns: 1fr 1fr;
  }

  .feedbackUploadRow {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .feedbackToast {
    right: 50%;
    bottom: 24px;
    transform: translate(50%, 14px);
  }

  .feedbackToast.show {
    transform: translate(50%, 0);
  }
}
