/*
 * Notepad (public copy): the landing sheet, the account sheets and the tag on the desk.
 * Everything is written on the same ruled paper as the pad, so heights stay whole numbers of --line
 * (see styles.css): form rows are one line tall, small print uses line-height 0 tricks only where needed.
 */

/* ---------- the tag on the desk: whose pad this is ---------- */

.whose {
  position: absolute;
  top: max(0.5rem, calc(2.5 * var(--u)));
  right: max(0.8rem, calc(4 * var(--u)));
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.2em 0.9em;
  max-width: calc(100vw - 1.6rem);
  padding: 0.15em 0.9em 0.2em;
  background: #fffbe6;
  box-shadow: 0 1px 2px #0005, 0 0.4em 0.8em -0.4em #0004;
  transform: rotate(1.2deg);
  font-family: 'Indie Flower', 'Comic Sans MS', Helvetica, Arial, sans-serif;
  font-size: max(15px, calc(3.2 * var(--u)));
  line-height: 1.5;
  color: #333;
}

/* a strip of tape holding it on */
.whose::before {
  content: "";
  position: absolute;
  top: -0.45em;
  left: 50%;
  width: 3.2em;
  height: 0.9em;
  translate: -50% 0;
  rotate: -3deg;
  background: #f6edc8d0;
  box-shadow: 0 0 1px #0003;
}

.whose-what { color: var(--pencil); }

.whose a {
  color: var(--pen);
  text-underline-offset: 0.15em;
  text-decoration-style: dotted;
}

.whose a.whose-go {
  color: #b00;
  text-decoration-style: solid;
}

.whose a:hover { color: #000; }

.whose a:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- the landing sheet and account sheets ---------- */

.landing .title,
.sheet .title { width: 100%; }

.landing-list { margin: 0; }

.landing-list .item .grip,
.landing-list .item .text { cursor: default; pointer-events: none; }

.landing-start { margin: 0; height: calc(var(--line) * 2); display: flex; align-items: center; }

.landing-go,
.sheet-go {
  height: var(--line);
  padding: 0 0.7em;
  border: 0;
  border-radius: 0.3em;
  background: var(--highlighter);
  box-shadow: inset 0 -0.12em 0 #e9c400;
  font: inherit;
  color: var(--pen);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.12s;
}

.landing-go { font-size: 1.15em; }

.landing-go:hover,
.sheet-go:hover { transform: rotate(-1deg) scale(1.03); }

.landing-go:focus-visible,
.sheet-go:focus-visible,
.sheet-link:focus-visible,
.sheet-form input:focus-visible,
.sheet-more summary:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
}

.sheet-go.danger {
  background: #ffc9c9;
  box-shadow: inset 0 -0.12em 0 #e08080;
  color: #900;
}

.landing-small,
.sheet-small,
.sheet-hint {
  font-size: 0.68em;
  color: var(--pencil);
}

.landing-small a,
.sheet-small a { color: var(--pen); }

/* A form: one ruled line per field, the label in pencil on the left, the answer written on the rule. */
.sheet-form {
  display: grid;
  margin: 0;
}

.sheet-form label {
  display: grid;
  grid-template-columns: minmax(5.5em, auto) 1fr;
  align-items: end;
  gap: 0.6em;
  height: var(--line);
  font-size: 0.8em;
  color: var(--pencil);
}

.sheet-form input {
  min-width: 0;
  height: var(--line);
  padding: 0 0.2em;
  border: 0;
  border-radius: 0.25em 0.25em 0 0;
  background: #fffc;
  box-shadow: inset 0 -2px 0 #99f;
  font: inherit;
  font-size: 1.25em;
  color: var(--pen);
}

.sheet-form input:hover { background: #fff; }

.sheet-form input::placeholder { color: var(--faint); }

.sheet-form input[type="password"] { letter-spacing: 0.12em; }

.sheet-form .sheet-hint { margin: 0; }

.sheet-form .sheet-go { justify-self: start; margin-top: 0; }

.sheet-form > :last-child { margin-bottom: var(--line); }

/* the honeypot: out of sight and out of the tab order */
.sheet-hp {
  position: absolute !important;
  left: -100vw;
  width: 1px;
  height: 1px !important;
  overflow: hidden;
}

.sheet-flash,
.sheet-error {
  margin: 0;
  min-height: var(--line);
  padding: 0 0.3em;
  font-size: 0.85em;
}

.sheet-flash { background: #c9f2d5aa; }

.sheet-error { background: #ffc9c9aa; color: #900; }

.sheet-row { margin: 0; height: var(--line); }

.sheet-link {
  height: var(--line);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8em;
  color: var(--pen);
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.sheet-more { margin: 0; }

.sheet-more summary {
  height: var(--line);
  font-size: 0.8em;
  color: var(--pen);
  cursor: pointer;
  list-style-position: inside;
}

.sheet-more[open] summary { color: #000; }

.sheet-danger summary { color: #b00; }

.code-box {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin: 0;
  height: calc(var(--line) * 2);
}

.code-box output {
  padding: 0 0.4em;
  background: var(--highlighter);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.82em;
  letter-spacing: 0.06em;
  color: #000;
  user-select: all;
}

@media (max-width: 640px) {
  /* room for the tag above the tab strip */
  body:has(.whose) .desk { padding-top: calc(15 * var(--u) + 30px); }

  .whose {
    top: 0.35rem;
    right: 0.5rem;
    font-size: 15px;
    gap: 0 0.7em;
  }
  .sheet-form label { grid-template-columns: 1fr; gap: 0; height: calc(var(--line) * 2); }
  .code-box { flex-wrap: wrap; height: auto; }
  .code-box output { font-size: 0.7em; }
}
