/* ==========================================================================
   Rules.txt — Notepad.
   Root: .app.app--rules (flex column, from shell.css). Menu bar and status
   bar are decoration; the text is a read-only, word-wrapped <textarea>.
   ========================================================================== */

.pad__menu {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  padding: var(--s-1) var(--s-2);
  font: var(--type-body);
  color: var(--c-text);
  user-select: none;
}

.pad__menu-item {
  padding: 3px 10px;
  border-radius: var(--r-sm);
}

.pad__text {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: var(--s-3) var(--s-4) var(--s-6);
  border: 0;
  border-top: 1px solid var(--c-stroke);
  border-radius: 0;
  background: var(--c-card);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  line-height: 22px;
  font-variant-ligatures: none;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  overflow-y: auto;
  resize: none;
  caret-color: var(--c-text);
  overscroll-behavior: contain;
}

.pad__text:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--c-accent-subtle-stroke);
}

.pad__status {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: var(--s-1) var(--s-2);
  border-top: 1px solid var(--c-stroke);
  color: var(--c-text-2);
  font: var(--type-caption);
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}

.pad__cell {
  padding: 0 var(--s-3);
}

.pad__cell--caret {
  margin-right: auto;
}

.pad__cell + .pad__cell {
  border-left: 1px solid var(--c-stroke-strong);
}

/* Tablet mode / touch: 16 px text so iOS does not zoom on focus. */
@media (pointer: coarse), (max-width: 899px) {
  .pad__text {
    padding: var(--s-3) var(--s-3) var(--s-6);
    font-size: 16px;
    line-height: 24px;
  }
}

@container app (max-width: 359px) {
  .pad__cell {
    padding: 0 var(--s-2);
  }
}
