/* The phone screen (phone.js): a stack of cards over everything else. */

.pf {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
body.pf-on { overflow: hidden; }

/* Each card is a screenful, and the stack stops on one at a time. */
.pf-cards {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch;
}
.pf-card {
  position: relative; box-sizing: border-box;
  height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  /* Up and down belongs to the stack; sideways is read in phone.js. */
  touch-action: pan-y;
}
.pf-sheet {
  height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 18px;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--primary);
  border-radius: 3px; box-shadow: 0 10px 24px -18px var(--edge);
  will-change: transform;
}
.pf-card.pf-dragging .pf-sheet { box-shadow: 0 18px 30px -20px var(--edge); }

.pf-sheet header { display: flex; align-items: baseline; gap: 10px; }
.pf-sheet h2 { font-size: 17px; line-height: 1.35; font-weight: 600; }
.pf-sheet p { font-size: 14px; line-height: 1.5; }
.pf-ago { margin-left: auto; font-size: 12px; color: var(--muted); }
.pf-asked { color: var(--muted); }
.pf-need { color: var(--warn); }
.pf-dim { color: var(--muted); }

.pf-ask { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-ask:empty { display: none; }
.pf-k { font-size: 11px; text-transform: lowercase; color: var(--secondary); margin-bottom: 6px; }
.pf-act { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; color: var(--text); }
/* An option is a whole sentence as often as a word, so each one has the width
   of the card and wraps inside it rather than running off the side. */
.pf-opts { display: grid; gap: 8px; margin-top: 12px; }
.pf-opts .btn { white-space: normal; text-align: left; height: auto; line-height: 1.4; }
/* A finger needs more than a pointer does. */
.pf-opts .btn, .pf-bar .btn { min-height: 38px; padding: 9px 14px; }
.pf-ask .md { overflow-wrap: anywhere; }
.pf-ask .md p { font-size: 14px; line-height: 1.5; }

/* What the swipe would do, showing through as the card moves. */
.pf-mark {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 13px; letter-spacing: .08em; text-transform: lowercase;
  opacity: 0; pointer-events: none;
}
.pf-left { left: 20px; color: var(--accent); }
.pf-right { right: 20px; color: var(--ok); }

.pf-last .pf-sheet { border-left-color: var(--line); justify-content: center; text-align: center; }

.pf-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--panel);
}
.pf-bar textarea {
  flex: 1; resize: none; height: 38px; max-height: 110px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--bg); color: var(--text);
}
.pf-bar .mic.on { border-color: var(--secondary); color: var(--secondary); }

.pf-undo {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-top: 1px solid var(--line);
  background: var(--element); font-size: 12px;
}
.pf-undo span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* On a wide screen it is a column in the middle, so it can be tried there. */
@media (min-width: 901px) {
  .pf-card { padding: 16px calc(50% - 230px); }
}
