:root {
  --note-font: 15px;
  --note-width: 240px;
  --frame-height: 80vh;
  --arrow-opacity: 0.4;
}

.page-wrap {
  max-width: 1040px;
}

body.focus-open {
  overflow: hidden;
}

.guestbook-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.guestbook-hint {
  margin: 0;
  font-size: 0.9rem;
}

.board-frame {
  height: var(--frame-height);
  overflow: auto;
  border: 2px dashed var(--ink);
  background: rgba(255, 255, 255, 0.35);
  overscroll-behavior: contain;
  cursor: grab;
}

.board-frame.is-panning,
.board-frame.is-panning .board {
  cursor: grabbing;
  user-select: none;
}

.board-sizer {
  position: relative;
  margin: 0 auto;
}

.board {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  cursor: text;
}

.arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: var(--arrow-opacity);
}

.arrows path {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrows .arrow-main {
  stroke-width: 2;
}

.arrows .arrow-sketch {
  stroke-width: 1.1;
  opacity: 0.5;
}

.note {
  position: absolute;
  z-index: 1;
  max-width: var(--note-width);
  padding: 4px 6px;
  font-size: var(--note-font);
  line-height: 1.4;
  cursor: default;

  text-shadow:
    0 0 2px #fff,
    0 0 4px #fff;
}

.note-text {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.note-name {
  margin-top: 2px;
  font-size: 0.8em;
  opacity: 0.75;
}

.note-date {
  display: none;
  margin-top: 2px;
  font-size: 0.7em;
  opacity: 0.6;
}

.note.show-date .note-date {
  display: block;
}

@media (hover: hover) {
  .note:hover .note-date {
    display: block;
  }
}

.note.is-linked {
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.note.is-linked:hover,
.note.is-linked:focus-visible {
  background: rgba(255, 225, 77, 0.35);
  outline: none;
}

.draft {
  position: absolute;
  z-index: 3;
  cursor: auto;
}

.draft-input {
  min-width: 140px;
  max-width: var(--note-width);
  min-height: 1.4em;
  padding: 6px 8px;
  font-size: var(--note-font);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  background: rgba(255, 255, 255, 0.75);
  border: 2px dotted var(--ink);
  outline: none;
  caret-color: var(--ink);
}

.draft-name {
  display: block;
  width: 100%;
  max-width: var(--note-width);
  margin-top: 4px;
  padding: 4px 8px;
  font-size: 0.85em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 2px dotted var(--ink);
  outline: none;
}

.draft-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.draft-count {
  margin-right: auto;
  font-size: 0.7rem;
  opacity: 0.6;
}

.draft-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: bold;
  line-height: 1;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  cursor: pointer;
}

.draft-confirm {
  background: #ffe14d;
}

.draft-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.draft.is-saving {
  opacity: 0.6;
  pointer-events: none;
}

.board-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.focus {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.focus[hidden] {
  display: none;
}

.focus-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 36px 8px 12px;
}

.focus-close {
  position: absolute;
  top: 0;
  right: 4px;
  padding: 0 8px;
  font-size: 1.8rem;
  line-height: 1.2;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
}

.focus-notes {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.focus-note {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.9);
  border: 2px dotted var(--ink);
}

.focus-note.is-current {
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(255, 225, 77, 0.7);
}

.focus-meta {
  margin-top: 8px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.focus-arrow {
  width: 34px;
  height: 42px;
  margin: 4px 0;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}
