* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  color: #000;
  background: #fff;
}

.page-tabs {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1rem 0;
}

.page-tabs a {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #000;
  text-decoration: none;
  opacity: 0.75;
}

.page-tabs a[aria-current="page"] {
  opacity: 1;
  text-decoration: underline;
}

.home-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 40;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #000;
  text-decoration: underline;
  opacity: 0.8;
}

.visitor-book {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.wall-wrap {
  position: relative;
  min-height: calc(100vh - 2.5rem);
  overflow: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  background-color: #f5f5f5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.06) 0,
      rgba(0, 0, 0, 0.06) 1px,
      transparent 1px,
      transparent 52px
    ),
    repeating-linear-gradient(
      to right,
      rgba(0, 0, 0, 0.05) 0,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px,
      transparent 96px
    );
}

.noise-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.95'/%3E%3C/svg%3E");
}

.draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden-canvas {
  display: none;
}

.wall-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 520px);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  opacity: 0.75;
  pointer-events: none;
}

.wall-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 0.4rem 0.55rem;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  backdrop-filter: blur(2px);
}

.brush-cursor {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  z-index: 20;
}

.toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  padding: 0.75rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.8rem;
}

.toolbar-left {
  display: grid;
  gap: 0.65rem;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.toolbar-label {
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-right: 0.3rem;
}

.zoom-readout {
  min-width: 44px;
  text-align: center;
  font-size: 11px;
}

.tool-btn,
.size-btn,
.save-btn,
.modal-btn {
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: transparent;
  color: #000;
  font: inherit;
  font-size: 11px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.tool-btn.active,
.size-btn.active {
  border-color: rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.06);
}

.save-btn {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.5rem 0.95rem;
  border-color: #000;
  background: #000;
  color: #fff;
}

.toolbar-actions {
  display: flex;
  flex-direction: row;
  gap: 0.45rem;
  align-items: center;
}

.secondary-btn {
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06);
}

.save-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.88);
}

.save-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.secondary-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.swatches {
  display: flex;
  gap: 0.35rem;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.swatch.active {
  outline: 2px solid rgba(0, 0, 0, 0.88);
  outline-offset: 1px;
}

.visitor-panel {
  min-height: calc(100vh - 2.5rem);
  background: #fff;
  color: #000;
  display: flex;
  flex-direction: column;
}

.visitor-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.visitor-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  overflow-y: auto;
  flex: 1;
}

.visitor-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  animation: slidein 260ms ease both;
}

.visitor-name {
  font-size: 12px;
  margin-bottom: 0.35rem;
}

.visitor-note {
  font-size: 11px;
  line-height: 1.55;
  opacity: 0.75;
}

.visitor-date {
  margin-top: 0.45rem;
  font-size: 10px;
  opacity: 0.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  width: min(92vw, 420px);
  background: #fff;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 1rem;
}

.modal h2 {
  margin: 0 0 1rem;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.modal input,
.modal textarea {
  width: 100%;
  background: #fff;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  font: inherit;
  font-size: 12px;
  margin-bottom: 0.75rem;
}

.modal textarea {
  min-height: 72px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.94);
  color: #000;
  padding: 0.55rem 0.75rem;
  font-size: 11px;
}

@keyframes slidein {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .visitor-book {
    grid-template-columns: 1fr;
  }

  .visitor-panel {
    min-height: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
  }

  .wall-wrap {
    min-height: 70vh;
    border-right: none;
  }
}
