:root {
  font-family: Inter, "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #202631;
  background: #eef0f3;
  font-size: 16px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #dce0e7;
  background: white;
  color: inherit;
  border-radius: 7px;
  padding: 9px 13px;
  font-size: 0.875rem;
  white-space: nowrap;
}
button:hover:not(:disabled) {
  background: #f0f3f9;
  border-color: #a2b0c6;
}
button:disabled,
select:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #7c9dfb;
  outline-offset: 2px;
}
.primary {
  background: #315cdb;
  color: white;
  border-color: #315cdb;
}
.primary:hover:not(:disabled) {
  background: #2346b1;
  color: white;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand strong {
  font-size: 1.25rem;
  letter-spacing: -1px;
}
.mark {
  display: grid;
  place-items: center;
  background: #315cdb;
  color: white;
  width: 33px;
  height: 33px;
  border-radius: 9px;
  font-size: 1.1rem;
}
.local {
  color: #737c8b;
  font-size: 0.8125rem;
  border-left: 1px solid #ddd;
  padding-left: 12px;
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 25px;
  background: #fff;
  border-bottom: 1px solid #e1e5eb;
  z-index: 4;
}
.file-info {
  flex: 1;
  min-width: 40px;
  text-align: center;
  font-size: 0.875rem;
  color: #596273;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#dirty {
  color: #315cdb;
  margin-left: 8px;
}
.file-actions {
  display: flex;
  gap: 10px;
}
.save-group {
  display: flex;
  position: relative;
}
.save-group > button:first-child {
  border-radius: 7px 0 0 7px;
}
.save-group > button:nth-child(2) {
  border-left: 0;
  border-radius: 0 7px 7px 0;
}
#save-options {
  position: absolute;
  right: 0;
  top: 45px;
  box-shadow: 0 8px 30px #1c2d4b22;
  padding: 5px;
  background: #fff;
  border-radius: 8px;
}
#bookmark-count {
  margin-left: 8px;
  color: #315cdb;
}
.tools {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  padding: 10px 25px;
  border-bottom: 1px solid #dce0e7;
  z-index: 3;
  flex-wrap: wrap;
}
.tool-group {
  display: flex;
  gap: 4px;
  padding-right: 18px;
  border-right: 1px solid #e1e5eb;
}
.tool-group button {
  border-color: transparent;
}
.tool-group button[aria-pressed="true"] {
  background: #eaf0ff;
  color: #234dbd;
  border-color: #d8e3ff;
}
.colors {
  gap: 9px;
}
.colors button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 5px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #dce0e7;
}
.colors .black {
  background: #202631 !important;
}
.colors .red {
  background: #d93645 !important;
}
.colors .blue {
  background: #2563eb !important;
}
.colors button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #315cdb;
  border-color: white;
}
.view-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.view-tools button {
  border: none;
  font-size: 1.2rem;
  padding: 4px 10px;
}
select {
  border: 0;
  background: white;
  font-size: 0.875rem;
}
main {
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  position: relative;
}
#viewer {
  overflow: auto;
  flex: 1;
  position: relative;
  scrollbar-gutter: stable;
}
#pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-width: max-content;
  padding: 32px 36px 80px;
}
.page {
  position: relative;
  background: white;
  box-shadow: 0 3px 16px #1a29451a;
  flex-shrink: 0;
}
.page canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.ink {
  z-index: 1;
  touch-action: pan-x pan-y;
}
.drawing .ink {
  touch-action: none;
  cursor: crosshair;
}
.erasing .ink {
  touch-action: none;
  cursor: cell;
}
#empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}
#empty[hidden] {
  display: none;
}
.empty-icon {
  width: 66px;
  height: 80px;
  background: white;
  border: 1px solid #d4dce9;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #315cdb;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 5px 6px 0 #e2e7f1;
  margin-bottom: 18px;
}
h1 {
  font-size: 1.65rem;
  letter-spacing: -1px;
  font-weight: 650;
  margin: 15px 0 4px;
}
#empty p {
  line-height: 1.9;
  color: #707989;
  margin-bottom: 25px;
}
#empty .primary {
  padding: 13px 22px;
}
#empty .primary span {
  margin-left: 28px;
}
small {
  font-size: 0.8125rem;
  color: #7b8391;
  margin-top: 23px;
}
aside {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  border-left: 0 solid #dce0e7;
  transition: width 0.18s;
}
aside.open {
  width: 310px;
  border-left-width: 1px;
  padding: 22px;
  overflow-y: auto;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-heading h2 {
  font-size: 1.1rem;
  margin: 0;
}
.panel-heading button {
  border: 0;
  font-size: 1.3rem;
}
.add-bookmark {
  margin-top: 20px;
  width: 100%;
  color: #315cdb;
  background: #f5f7fe;
  border-style: dashed;
}
.panel-hint {
  font-size: 0.8125rem;
  color: #7b8391;
  line-height: 1.7;
  margin-bottom: 25px;
}
.bookmark-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #edf0f4;
  padding: 10px 0;
  gap: 3px;
}
.bookmark-row .jump {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 0;
  line-height: 1.5;
}
.bookmark-row button {
  padding: 6px;
}
.bookmark-row small {
  display: block;
  margin: 3px 0 0;
}
.bookmark-row .minor {
  font-size: 0.75rem;
  border: 0;
  color: #737c8b;
}
.list-empty {
  color: #7b8391;
  line-height: 1.8;
  font-size: 0.875rem;
}
#page-number {
  width: 48px;
  border: 1px solid #dce0e7;
  border-radius: 4px;
  text-align: center;
  padding: 3px;
  font-size: 0.8125rem;
}
#status {
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
dialog {
  border: 1px solid #dce0e7;
  border-radius: 14px;
  padding: 26px;
  width: 420px;
  max-width: calc(100% - 40px);
  box-shadow: 0 20px 80px #16254433;
}
dialog::backdrop {
  background: #1e2d4655;
}
dialog h2 {
  font-size: 1.2rem;
  margin-top: 0;
}
dialog p {
  color: #6a7382;
  line-height: 1.6;
}
dialog input {
  width: 100%;
  padding: 11px;
  border: 1px solid #bdc8d9;
  border-radius: 6px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 25px;
}
@media (prefers-reduced-motion: reduce) {
  aside {
    transition: none;
  }
}

/* One header row; the palette overlays the remaining viewer surface. */
header {
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  gap: 14px;
  flex-wrap: nowrap;
}
.brand {
  gap: 9px;
  flex-shrink: 0;
}
.brand .local {
  display: none;
}
.brand .mark {
  width: 29px;
  height: 29px;
  font-size: 1rem;
}
.brand strong {
  font-size: 1.05rem;
}
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-width: 0;
}
.document-name {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
}
#filename {
  overflow: hidden;
  text-overflow: ellipsis;
}
#dirty {
  flex-shrink: 0;
  font-size: 0.75rem;
}
#status {
  flex: 1 1 80px;
  min-width: 0;
  max-width: none;
  font-size: 0.75rem;
  color: #778191;
}
.file-actions {
  flex-shrink: 0;
  gap: 6px;
}
header button {
  padding: 7px 10px;
}
.page-navigation {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  border-left: 1px solid #e1e5eb;
  padding-left: 12px;
  font-size: 0.8125rem;
}
.page-navigation button {
  border: 0;
  padding: 4px 6px;
}
.view-tools {
  flex-shrink: 0;
  margin-left: 0;
  gap: 2px;
  border-left: 1px solid #e1e5eb;
  padding-left: 10px;
}
.view-tools button {
  padding: 3px 6px;
}
.privacy {
  border: 0;
  padding: 4px;
  color: #748095;
  display: grid;
  place-items: center;
}
.privacy svg {
  width: 18px;
  height: 18px;
}
.tools {
  position: absolute;
  left: 16px;
  top: 20px;
  width: 56px;
  max-width: 100%;
  max-height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-wrap: nowrap;
  align-items: stretch;
  border: 1px solid #dce0e7;
  border-radius: 12px;
  box-shadow: 0 4px 18px #23345124;
  z-index: 6;
  user-select: none;
  overflow: hidden;
}
#palette-handle {
  flex-shrink: 0;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #929cab;
  cursor: grab;
  touch-action: none;
  font-size: 22px;
  line-height: 1;
}
#palette-handle:active {
  cursor: grabbing;
}
.palette-body {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.tool-group {
  flex-direction: column;
  gap: 3px;
  padding: 5px 0;
  border-right: 0;
  border-bottom: 1px solid #e8ecf2;
  align-items: center;
}
.tool-group:last-child {
  border-bottom: 0;
}
.tool-group button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 34px;
  padding: 6px;
  flex-shrink: 0;
}
.tool-group svg {
  width: 21px;
  height: 21px;
}
.colors {
  gap: 9px;
  padding: 11px 0;
}
.colors button {
  width: 22px;
  height: 22px;
  padding: 0;
  border-width: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
