/* memory.css — the operator's own notebook, one more Amiga Workbench 1.3
   window in the account's chrome (pay.css holds the --wb-* palette, the
   .wb-bar gadgets, the bevels, the buttons and the fields). Here: the frame,
   the key/value rows, the numbered notes, the tag chips and the sunken block
   the tape fills in by itself. Phone first: one column, nothing wider than
   the screen, every field big enough for a thumb. */

#mem-veil {
  position: fixed;
  inset: 0;
  z-index: 9750;                  /* over the film, the title card, the hall and the account window */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 10, 30, 0.55);
  font-family: var(--px-body);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smooth: never;
  user-select: none;
  -webkit-user-select: none;
}
#mem-veil.on { display: flex; }

#mem-win {
  width: min(620px, 94vw);
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--wb-blue);
  color: var(--wb-white);
  border: 2px solid;
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  box-shadow: 0 0 0 2px var(--wb-black), 8px 8px 0 0 rgba(0, 0, 0, 0.45);
  outline: none;
  font-size: 22px;
  line-height: 1.15;
}
#mem-win [hidden] { display: none !important; }
.mem-body { padding: 14px 16px 16px; overscroll-behavior: contain; }
.mem-lead { margin: 0 0 12px; font-size: 20px; opacity: 0.9; }
.mem-hint { margin: 6px 0 8px; font-size: 17px; line-height: 1.25; opacity: 0.8; }
.mem-body .wb-sec { margin-top: 16px; }
.mem-body .wb-sec:first-of-type { margin-top: 8px; }

/* ---------- the key/value rows: preferences and facts ---------- */
.mem-rows { display: flex; flex-direction: column; gap: 8px; }
.mem-row { display: flex; align-items: center; gap: 8px; }
.mem-row .mem-k { flex: 0 0 34%; min-width: 0; }
.mem-row .mem-v { flex: 1 1 auto; min-width: 0; }
.mem-body .wb-input { height: 40px; font-size: 20px; }

/* the small square that throws a row away */
.mem-x {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 2px solid;
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  border-radius: 0;
  background: var(--wb-blue);
  color: var(--wb-white);
  font-family: var(--px-body);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}
.mem-x:hover, .mem-x:focus-visible { background: var(--wb-orange); color: var(--wb-black); }
.mem-x:active { border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black); transform: translate(1px, 1px); }

/* ---------- the notes ---------- */
.mem-notes { list-style: none; margin: 0; padding: 0; }
.mem-note {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}
.mem-n { font-family: var(--px-title); font-size: 13px; text-align: right; color: var(--wb-orange); }
.mem-tx { font-size: 20px; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.mem-ts { font-size: 15px; opacity: 0.7; white-space: nowrap; }
.mem-none { padding: 8px 0; font-size: 19px; opacity: 0.75; }
/* a gadget that only adds one more line does not need the whole width */
.mem-body .wb-row .wb-btn[data-act^="add-"] { flex: 0 0 auto; }
.mem-add { align-items: stretch; }
.mem-add .mem-new { flex: 1 1 14em; min-width: 0; }
.mem-add .wb-btn { flex: 0 0 auto; }

/* ---------- the tags ---------- */
.mem-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 2px 8px;
  font-size: 18px;
  background: var(--wb-white);
  color: var(--wb-blue);
  border: 2px solid;
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  overflow-wrap: anywhere;
}
.mem-tag .mem-x {
  width: 22px;
  height: 22px;
  font-size: 14px;
  background: var(--wb-white);
  color: var(--wb-blue);
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
}
.mem-tag .mem-x:hover, .mem-tag .mem-x:focus-visible { background: var(--wb-orange); color: var(--wb-black); }

/* ---------- what the tape fills in by itself: read only, sunk in ---------- */
.mem-auto {
  margin: 0;
  padding: 10px 12px;
  border: 2px solid;
  border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black);
  grid-template-columns: minmax(8em, auto) minmax(0, 1fr);
  gap: 5px 14px;
}
.mem-auto dt { font-size: 18px; opacity: 0.8; }
.mem-auto dd { font-size: 19px; color: var(--wb-orange); word-break: normal; overflow-wrap: anywhere; }

/* ---------- the line that says what happened ---------- */
.mem-status { margin: 10px 0 0; min-height: 1.2em; font-size: 19px; opacity: 0.9; }
.mem-status.ok { color: var(--wb-orange); }
.mem-status.warn { display: inline-block; padding: 4px 10px; background: var(--wb-orange); color: var(--wb-black); opacity: 1; }

@media (max-width: 480px) {
  #mem-win { font-size: 20px; }
  .mem-body { padding: 12px 10px 14px; }
  .mem-row { flex-wrap: wrap; }
  .mem-row .mem-k { flex: 1 1 100%; }
  .mem-row .mem-v { flex: 1 1 60%; }
  .mem-note { grid-template-columns: 1.6em minmax(0, 1fr) auto; }
  .mem-note .mem-ts { display: none; }      /* the narrow screen keeps the line, not the day */
  .mem-auto { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mem-auto dd { margin-bottom: 6px; }
}
