:root {
  color-scheme: light;
  font: 16px system-ui, sans-serif;
  color: #25291f;
  background: #f3f1e9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header, .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
header {
  justify-content: space-between;
  min-height: calc(4.75rem + 1px);
  padding: 1rem max(1rem, 5vw);
  border-bottom: 1px solid #d6d4c9;
}
header a { font: 1.65rem Georgia, serif; text-decoration: none; }
a { color: #315941; }
main { max-width: 62rem; margin: auto; padding: 1rem clamp(1rem, 4vw, 3rem) 3rem; }
#startup-status {
  position: absolute;
  inset: 5.75rem 1rem auto;
  margin: 0;
  text-align: center;
  color: #536157;
  animation: show-startup 0s .2s both;
}
@keyframes show-startup { from { visibility: hidden; } to { visibility: visible; } }
body:has(#app[aria-busy="true"]) #sign-out, #app[aria-busy="true"] { visibility: hidden; }
body:has(#app[aria-busy="false"]) #startup-status { display: none; }
h1 { font: 2rem Georgia, serif; overflow-wrap: anywhere; }
form { display: grid; gap: .85rem; max-width: 26rem; margin-bottom: 1rem; }
label { display: grid; gap: .35rem; }
input, button, textarea { font: inherit; }
input, button { min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid #787f71; border-radius: .35rem; }
button { background: #e0eadc; color: #243f2c; cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
button[aria-pressed="true"]:not(:disabled) { background: #315941; color: #fffefa; border-color: #315941; }
:focus-visible { outline: 2px solid #315941; outline-offset: 3px; }
#notice { min-height: 1.4em; }
.account-panel {
  max-width: 32rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid #d6d4c9;
  background: #fffefa;
  border-radius: .5rem;
}
.account-panel h1 { margin-top: 0; }
.account-panel p { line-height: 1.55; overflow-wrap: anywhere; }
.account-panel .account-email {
  padding: .65rem .85rem;
  background: #f3f1e9;
  border-radius: .35rem;
}
.account-panel .toolbar { margin-top: 1.25rem; }
.account-panel form { max-width: none; }
.account-panel input { width: 100%; }
.account-link {
  border: 0;
  padding-inline: 0;
  background: transparent;
  color: #315941;
  text-decoration: underline;
}
.account-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid #787f71;
  border-radius: .35rem;
  background: #e0eadc;
  text-decoration: none;
}
li { margin-block: .75rem; overflow-wrap: anywhere; }
body:has(#editor:not([hidden])) { display: flex; flex-direction: column; height: 100dvh; }
body:has(#editor:not([hidden])) > header { flex: 0 0 auto; }
#sign-out {
  border: 0;
  background: transparent;
  color: #46534b;
  font-size: .875rem;
}
#sign-out:hover { background: #e9e9e1; }
main:has(#editor:not([hidden])) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0 clamp(.65rem, 2vw, 1.5rem) .65rem;
}
#editor { display: flex; flex: 1; flex-direction: column; min-height: 0; }
#editor > :not(.workspace) { flex-shrink: 0; }
.editor-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .8rem;
  padding: .8rem 0 .65rem;
}
.editor-heading > a { font-size: .8rem; color: #536157; text-decoration: none; }
.editor-heading > a:hover { text-decoration: underline; }
.editor-heading h1 { margin: 0; font-size: 1.4rem; }
.editor-heading #notice { min-height: 0; margin: 0 0 0 auto; font-size: .8rem; color: #4b5c51; }
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .55rem;
  margin-bottom: .45rem;
  font-size: .85rem;
}
.control-group {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  max-width: 100%;
  padding: .15rem;
  border: 1px solid #dedfd5;
  border-radius: .65rem;
  background: #fbfbf6;
}
.editor-toolbar button, .editor-toolbar select {
  min-height: 2.35rem;
  padding: .35rem .65rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: #34443b;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
}
.editor-toolbar button:hover:not(:disabled), .editor-toolbar select:hover { background: #eeefe7; }
.editor-toolbar button[aria-pressed="true"]:not(:disabled) {
  background: #315941;
  color: #fffefa;
  border-color: #315941;
}
.editor-toolbar button:disabled { opacity: .46; }
.editor-toolbar :focus-visible { outline-offset: 1px; }
.history-controls button {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
}
.history-controls svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zoom-controls button { min-width: 2.35rem; padding-inline: .35rem; font-size: 1.15rem; }
.zoom-controls output { min-width: 3.1rem; text-align: center; font-variant-numeric: tabular-nums; color: #4b5c51; }
.page-picker select { cursor: pointer; max-width: 10rem; }
.workspace-tools { margin-bottom: .65rem; }
.eraser-options {
  margin-left: .1rem;
  padding-left: .55rem;
  border-left: 2px solid #becbbf;
}
.eraser-options[data-inactive] { visibility: hidden; }
.eraser-sizes[data-inactive] { visibility: hidden; }
.eraser-sizes button {
  display: grid;
  place-items: center;
  min-width: 2.35rem;
  padding: .35rem;
}
.eraser-sizes button::before {
  content: '';
  width: var(--swatch-size);
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.eraser-sizes [data-eraser-diameter="6"] { --swatch-size: .45rem; }
.eraser-sizes [data-eraser-diameter="12"] { --swatch-size: .75rem; }
.eraser-sizes [data-eraser-diameter="24"] { --swatch-size: 1.15rem; }
.workspace {
  position: relative;
  flex: 1;
  min-height: 10rem;
  overflow: hidden;
  background: #e9e7df;
  border: 1px solid #dedbd1;
  border-radius: .65rem;
  touch-action: none;
}
.workspace[data-hand] { cursor: grab; }
.workspace[data-panning] { cursor: grabbing; }
.workspace[data-hand] .paper { pointer-events: none; }
#scene { position: absolute; transform-origin: 0 0; }
.paper { position: absolute; background: #fffefa; outline: 1px solid #d6d4c9; }
#page { width: 630px; height: 891px; }
.ink-layer { position: absolute; pointer-events: none; }
.eraser-cursor { position: absolute; z-index: 2; border: 1px solid #47745b; border-radius: 50%; pointer-events: none; }
#page[data-tool="pen"], #page[data-tool="eraser"] { cursor: crosshair; }
#page[data-tool="eraser"]:has(.eraser-cursor:not([hidden])) { cursor: none; }
#page[data-tool="pen"] .text-block, #page[data-tool="eraser"] .text-block { pointer-events: none; }
#sample-paper { left: 714px; top: 126px; width: 891px; height: 630px; }
.sample-text { position: absolute; left: 8%; top: 10%; color: #51594d; line-height: 1.5; }
.text-block {
  position: absolute;
  width: 35%;
  height: 10.77%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  border: 1px solid #d6d4c9;
  border-radius: .3rem;
  background: #fffefa;
  cursor: grab;
}
.text-block:active { cursor: grabbing; }
.text-block:focus:not(:focus-visible), .text-block[data-selected]:focus { outline: none; }
#page:focus { outline: none; }
.selection-frame {
  position: absolute;
  z-index: 1;
  outline: 2px solid #47745b;
  pointer-events: none;
}
.resize-handle {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  background: #e0eadc;
  pointer-events: auto;
  touch-action: none;
}
.resize-handle[data-corner="nw"] { top: -.5rem; left: -.5rem; cursor: nwse-resize; }
.resize-handle[data-corner="ne"] { top: -.5rem; right: -.5rem; cursor: nesw-resize; }
.resize-handle[data-corner="sw"] { bottom: -.5rem; left: -.5rem; cursor: nesw-resize; }
.resize-handle[data-corner="se"] { bottom: -.5rem; right: -.5rem; cursor: nwse-resize; }
.resize-handle[data-corner="w"], .resize-handle[data-corner="e"] {
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}
.resize-handle[data-corner="w"] { left: -.5rem; }
.resize-handle[data-corner="e"] { right: -.5rem; }
.selection-box {
  position: absolute;
  border: 1px solid #47745b;
  background: #47745b20;
  pointer-events: none;
}
.block-text, .block-label {
  width: 100%;
  min-height: 0;
  border: 0;
  resize: none;
  background: transparent;
  color: inherit;
  padding: .45em .55em;
  line-height: 1.45;
}
.block-label { align-self: start; max-height: 100%; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; }
