:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #66757f;
  --line: #dbe4e1;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --soft: #e7f8f4;
  --danger: #be123c;
  --warning: #b45309;
  --shadow: 0 14px 32px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
.upload-button {
  cursor: pointer;
}

.file-mode-warning {
  display: none;
  padding: 12px 18px;
  color: #7c2d12;
  background: #ffedd5;
  border-bottom: 1px solid #fed7aa;
  font-weight: 800;
}

.file-mode .file-mode-warning {
  display: block;
}

.file-mode-warning a {
  color: #115e59;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.86)),
    var(--bg);
}

.auth-locked .login-screen {
  display: grid;
}

.auth-locked .app-header,
.auth-locked .app-main,
.auth-locked .content-modal {
  display: none;
}

.auth-ready .login-screen {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-bottom: 26px;
  font-size: 32px;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.login-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.login-card input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.login-card .primary-button {
  width: 100%;
  margin-top: 16px;
  border: 0;
}

.login-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-button,
.primary-button,
.danger-button,
.open-link,
.toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 800;
  text-decoration: none;
}

.small-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.title-editor {
  display: grid;
  align-items: start;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.title-editor h2 {
  margin-bottom: 0;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-editor input {
  display: none;
  min-width: 220px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
}

.title-editor .small-button {
  width: fit-content;
}

.title-editor.editing h2 {
  display: none;
}

.title-editor.editing input {
  display: block;
}

.ai-action-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px;
  min-height: 38px;
}

.ai-action-panel[hidden] {
  display: none;
}

.ai-action-panel .primary-button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
}

.ai-action-panel .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.ai-action-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ai-action-status.error {
  color: var(--warning);
}

.ai-action-status.success {
  color: var(--accent-dark);
}

.legacy-toggle {
  display: none;
}

.article-mode-switch {
  display: inline-flex;
  gap: 6px;
  margin: 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #f8faf9;
}

.mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
}

.mode-button.active {
  color: #ffffff;
  background: var(--accent);
}

.translation-reader {
  height: 75vh;
  min-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 34px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.translation-reader h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.35;
}

.translation-meta {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.translation-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.translation-section h3 {
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: 19px;
}

.translation-section p {
  margin-bottom: 14px;
  color: #26343d;
  font-size: 16px;
  line-height: 1.9;
}

.translation-empty {
  display: grid;
  place-content: center;
  min-height: 360px;
  text-align: center;
}

.translation-empty p {
  font-size: 17px;
  font-weight: 800;
}

.viewer-body[data-mode="translation"] .pdf-mode-panel {
  display: none;
}

.viewer-body[data-mode="pdf"] .translation-reader {
  display: none;
}

.pdf-mode-panel[hidden] {
  display: none;
}

.upload-button,
.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.upload-button:hover,
.primary-button:hover {
  background: var(--accent-dark);
}

.upload-button input {
  display: none;
}

.danger-button {
  color: var(--danger);
  border-color: #fecdd3;
  background: #fff1f2;
}

.open-link {
  color: var(--accent-dark);
  border-color: #99f6e4;
  background: #ccfbf1;
}

.open-link.disabled {
  pointer-events: none;
  color: var(--muted);
  border-color: var(--line);
  background: #f1f5f4;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toggle-button {
  color: var(--accent-dark);
  border-color: var(--line);
  background: #ffffff;
}

.toggle-button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.app-layout,
.app-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 16px;
  height: calc(100vh - 110px);
  min-height: 0;
  overflow: hidden;
  max-width: 100vw;
}

.paper-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #edf3f1;
}

.reader-shell {
  display: contents;
}

.side-panel,
.article-panel,
.result-panel {
  min-width: 0;
  overflow: hidden;
}

.paper-sidebar {
  overflow-x: hidden;
  overflow-y: auto;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compact-panel {
  padding: 14px;
}

.section-title,
.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-title span {
  color: var(--accent-dark);
  font-weight: 900;
}

.paper-list {
  display: grid;
  gap: 8px;
}

.sidebar-menu {
  display: grid;
  gap: 8px;
}

.sidebar-menu button,
.add-folder-button,
.folder-main,
.folder-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8faf9;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.sidebar-menu button:hover,
.add-folder-button:hover,
.folder-main:hover,
.folder-action:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.folder-list {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 5px;
}

.folder-main.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--soft);
}

.folder-action {
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 12px;
}

.add-folder-button {
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent-dark);
}

.sidebar-subtitle {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.paper-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #f8faf9;
  text-align: left;
}

.paper-item button {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.paper-item select {
  width: 100%;
  min-height: 32px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.paper-item:hover,
.paper-item.active {
  border-color: var(--accent);
  background: #ecfdf5;
}

.paper-item strong,
.paper-item span {
  display: block;
}

.paper-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e5ebe9;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.45s ease;
}

.current-status {
  margin-top: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--accent-dark);
  background: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.step-list {
  display: none;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
}

.step-list li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 10px 10px 36px;
  color: var(--muted);
  background: #f8faf9;
  font-weight: 700;
}

.step-list li::before {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #cbd5d2;
  content: "";
  transform: translateY(-50%);
}

.step-list li.active {
  color: var(--accent-dark);
  border-color: #99f6e4;
  background: #ecfdf5;
}

.step-list li.done::before,
.step-list li.active::before {
  background: var(--accent);
}

.pdf-pane,
.ai-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
}

.pdf-pane {
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow: hidden;
}

.ai-pane {
  width: 30%;
  max-width: 30%;
  overflow-y: auto;
}

.article-panel {
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.viewer-body {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.result-panel {
  width: 100%;
  max-width: none;
  overflow-y: auto;
}

.pdf-pane.collapsed .viewer-body {
  display: none;
}

.pdf-pane.collapsed {
  align-content: start;
}

.parse-status,
.render-status {
  display: none;
  margin: 4px 0 12px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: #f1f5f4;
  font-weight: 800;
}

.parse-status.success,
.render-status.success {
  color: var(--accent-dark);
  background: #ccfbf1;
}

.parse-status.error,
.render-status.error {
  color: var(--warning);
  background: #fef3c7;
}

.pdf-viewer {
  position: relative;
  overflow-y: auto;
  overflow-x: scroll;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  height: 75vh;
  max-width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #2f3437;
  text-align: center;
  scrollbar-gutter: stable;
}

.pdf-x-scroll {
  display: none;
  width: 100%;
  height: 18px;
  margin-bottom: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
  background: #252a2d;
}

.pdf-x-scroll.visible {
  display: block;
}

.pdf-x-scroll-spacer {
  width: 100%;
  height: 1px;
}

.pdf-pages {
  display: none;
  gap: 24px;
  padding: 16px;
  justify-items: center;
  align-items: start;
  min-width: 100%;
  width: max-content;
}

.pdf-viewer.has-pdf .pdf-pages {
  display: grid;
}

.pdf-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  min-width: 100%;
  overflow: visible;
}

.page-stack {
  position: relative;
  width: max-content;
  max-width: none;
  display: grid;
  justify-items: center;
}

.pdf-page canvas {
  display: block;
  max-width: none;
  height: auto;
  box-shadow: 0 8px 26px rgba(31, 41, 51, 0.18);
  background: var(--surface);
}

.page-number {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page-error {
  width: 100%;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 18px;
  color: var(--warning);
  background: #fef3c7;
  text-align: center;
  font-weight: 800;
}

.pdf-viewer.has-pdf .empty-view {
  display: none;
}

.tool-directory {
  display: grid;
  gap: 18px;
}

.directory-list {
  display: grid;
  gap: 8px;
}

.directory-list button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #f8faf9;
  text-align: left;
  font-weight: 800;
}

.directory-list button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.result-panel .tabs,
.result-panel .tab-panel,
.result-panel .tab-panel.active,
.result-panel .summary-grid,
.result-panel .notes-form,
.result-panel .summary-card,
.result-panel .empty-card,
.legacy-content-store {
  display: none !important;
}

.empty-view,
.empty-card {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 24px;
  text-align: center;
}

.empty-card {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  width: max-content;
}

.tab {
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: #ffffff;
  background: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.summary-grid {
  display: grid;
  gap: 14px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.summary-card h3 {
  color: var(--accent-dark);
}

.summary-card p {
  margin-bottom: 10px;
}

.summary-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.summary-card li {
  line-height: 1.55;
}

.notes-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #ffffff;
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.save-status {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.content-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.content-modal.open {
  display: block;
}

.content-modal.calendar-mode .modal-panel {
  right: 5vw;
  width: 90vw;
  max-width: none;
  min-width: 0;
  height: 90vh;
}

.content-modal.calendar-mode .modal-header {
  padding: 12px 16px;
}

.content-modal.calendar-mode .modal-body {
  padding: 12px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  position: absolute;
  top: 50%;
  right: 32px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, calc(100vw - 64px));
  max-width: 760px;
  height: 80vh;
  min-width: min(600px, calc(100vw - 64px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  transform: translateY(-50%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.modal-summary {
  display: grid;
  gap: 16px;
}

.modal-summary p {
  margin-bottom: 0;
  line-height: 1.78;
}

.modal-summary ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
}

.modal-summary li {
  line-height: 1.6;
}

.reading-summary {
  position: relative;
}

.summary-block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-block h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 16px;
}

.summary-lead,
.key-takeaway {
  background: #f0fdfa;
}

.key-takeaway {
  border-color: #99f6e4;
}

.term-chip {
  display: inline;
  border: 0;
  border-radius: 5px;
  padding: 1px 4px;
  color: #0f766e;
  background: #ccfbf1;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.term-chip:hover {
  color: #ffffff;
  background: var(--accent);
}

.term-popover {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid #5eead4;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.2);
}

.term-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.term-popover h3,
.term-popover p {
  margin: 0;
}

.term-translation {
  color: var(--accent-dark);
  font-weight: 900;
}

.term-context {
  display: grid;
  gap: 6px;
  border-left: 4px solid #99f6e4;
  padding-left: 10px;
}

.modal-note {
  display: grid;
  gap: 10px;
  height: 100%;
}

.modal-note textarea {
  min-height: 52vh;
  resize: none;
}

.tool-panel {
  display: grid;
  gap: 20px;
}

.tool-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.tool-form .form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.tool-form input,
.tool-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  font-size: 15px;
}

.todo-list,
.event-list {
  display: grid;
  gap: 12px;
}

.todo-item,
.event-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.todo-item {
  font-size: 16px;
}

.todo-item.done {
  opacity: 0.62;
  background: #f1f5f4;
}

.todo-item.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-item p {
  margin: 4px 0 0;
  font-size: 14px;
}

.todo-item em {
  display: inline-block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.todo-top,
.event-top,
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.todo-main {
  display: flex;
  align-items: start;
  gap: 12px;
}

.todo-main input {
  width: 22px;
  height: 22px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.delete-mini {
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--danger);
  background: #fff1f2;
  font-size: 12px;
  font-weight: 900;
}

.calendar-header button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--accent-dark);
  background: #ffffff;
  font-weight: 900;
  font-size: 15px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 20px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

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

.calendar-main,
.calendar-side {
  min-width: 0;
}

.calendar-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  text-align: left;
}

.calendar-day.today {
  border-color: #5eead4;
  background: #ecfdf5;
}

.calendar-day.today strong {
  color: var(--accent-dark);
  font-weight: 900;
}

.calendar-day.outside {
  opacity: 0.38;
  background: #f1f5f4;
}

.calendar-day strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.calendar-chip {
  overflow: hidden;
  margin-top: 2px;
  border-radius: 6px;
  min-height: 15px;
  padding: 1px 5px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  margin-top: 2px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.event-item {
  font-size: 15px;
}

.event-item p {
  margin: 0;
  font-size: 14px;
}

.empty-small {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8faf9;
  text-align: center;
}

@media (max-width: 760px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-layout {
    display: block;
    height: auto;
    overflow: visible;
  }

  .reader-shell {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .paper-sidebar {
    width: 100%;
    max-width: none;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pdf-pane,
  .ai-pane {
    width: 100%;
    max-width: none;
    height: auto;
    overflow: visible;
  }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .app-main {
    grid-template-columns: 180px minmax(0, 1fr) 260px;
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .app-main {
    grid-template-columns: 240px minmax(0, 1fr) 260px;
  }
}

@media (max-width: 680px) {
  .app-header,
  .header-actions,
  .pane-header {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header,
  .paper-sidebar,
  .reader-shell {
    padding-left: 14px;
    padding-right: 14px;
  }
}
