:root {
  --page-width: 816px;
  --page-height: 1056px;
  --page-margin-top: 96px;
  --page-margin-bottom: 96px;
  --page-margin-left: 96px;
  --page-margin-right: 96px;
  --page-color: white;
}

.visual-page-sheet {
  width: var(--page-width);
  height: var(--page-height);
  background-color: var(--page-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  padding-top: var(--page-margin-top);
  padding-right: var(--page-margin-right);
  padding-bottom: var(--page-margin-bottom);
  padding-left: var(--page-margin-left);
  box-sizing: border-box;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
  cursor: text;
}

.page-content {
  flex: 1;
  max-height: calc(var(--page-height) - var(--page-margin-top) - var(--page-margin-bottom));
  background-color: transparent;
  border: none;
  outline: none;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.7;
  cursor: text;
  position: relative;
}

.page-content:empty::before,
.page-content:has(> p:only-child:empty)::before,
.page-content:has(> p:only-child > br:only-child)::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
  display: block;
  position: absolute;
}

.page-content p { margin: 0; min-height: 1em; }
.page-content > *:last-child { margin-bottom: 0 !important; }

.page-content ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin: 0.25em 0;
}

.page-content ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin: 0.25em 0;
}

.page-content li {
  min-height: 1em;
}

.page-content ul ul { list-style-type: circle; }
.page-content ul ul ul { list-style-type: square; }

.page-content a {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

body {
  user-select: none;
  -webkit-user-select: none;
}

.page-content, input, textarea, select, .ai-panel-content {
  user-select: text;
  -webkit-user-select: text;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.animate-blink {
  animation: blink 1s step-end infinite;
}

@keyframes slideUp {
  0% { transform: translateY(100%); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  75% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

.animate-slideUp {
  animation: slideUp 2s ease-in-out forwards;
}

/* Custom Range Slider Thumb */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
  margin-top: -2px;
}

input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
}
