/* lexicographer-viewer: the slim bar above each tile, and the space the tile fills. */
:root {
  --paper: #f6f3ec;
  --ink: #1f1d1a;
  --muted: #6b655b;
  --rule: #d9d2c3;
  --stage: #ffffff;
  --accent: #8a3b2a;
  --away: #2f5b86;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1a18;
    --ink: #ece7dc;
    --muted: #a39c8f;
    --rule: #3a3731;
    --stage: #111110;
    --accent: #e0907c;
    --away: #8fb8e2;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  background: var(--stage);
  color: var(--ink);
  font: 15px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 40px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site {
  flex: 0 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-variant: small-caps;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.what {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  display: flex;
  gap: 0.35em;
  white-space: nowrap;
}
/* The title gives way first, so who made the tile always stays in view. */
.title {
  flex: 0 1 auto;
  min-width: 2em;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.by {
  flex: 0 0 auto;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.away {
  flex: 0 0 auto;
  color: var(--away);
  text-decoration: none;
  font-size: 14px;
}
.away:hover { text-decoration: underline; }
.away:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report {
  flex: 0 0 auto;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.site:hover, .report:hover { text-decoration: underline; }
.site:focus-visible, .report:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
/* The tile's frame fills the stage (the loader gives it a fixed height; this wins). */
.stage > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  border: 0;
  background: var(--stage);
}
/* Shown over the frame until the tile is under way (src/browser/web-tile-mount.js). */
.web-tile-status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--stage);
}
.web-tile-status[hidden] { display: none; }
.web-tile-loading { color: var(--muted); }
.web-tile-retry {
  font: inherit;
  font-size: 14px;
  padding: 6px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.web-tile-retry[hidden] { display: none; }
.web-tile-retry:hover { border-color: var(--muted); }
.web-tile-retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) {
  .bar { gap: 10px; padding: 0 12px; }
  /* On a tile page the title and creator need the room; the site's own pages keep the name. */
  body:not(.plain) .site { display: none; }
  /* The appmosphe.re link shrinks to its arrow, so the creator stays readable. */
  .away-name { display: none; }
}

/* ---- The site's own pages (home, errors, takedowns): src/pages.js ---- */
body.plain { background: var(--paper); }
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 40px 16px 32px;
  line-height: 1.55;
}
.page h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 16px;
}
.page h2 {
  font-size: 16px;
  margin: 28px 0 6px;
}
.page h3 {
  font-size: 15px;
  margin: 20px 0 6px;
  color: var(--muted);
}
.page p { margin: 0 0 12px; }
.page ul { margin: 0 0 12px; padding-left: 22px; }
.page li { margin: 0 0 4px; }
.page a { color: var(--accent); }
.page code {
  font: 14px ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--stage);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0 4px;
  overflow-wrap: anywhere;
}
.page .back { margin-top: 24px; }
.page mark.todo {
  background: #fff1b8;
  color: #3d3200;
  padding: 1px 4px;
  border-radius: 3px;
}
.open { margin: 24px 0 12px; }
.open label { display: block; font-weight: 600; margin-bottom: 6px; }
.open .row { display: flex; gap: 8px; }
.open input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--stage);
  color: var(--ink);
}
.open input[aria-invalid="true"] { border-color: var(--accent); }
.open button {
  flex: 0 0 auto;
  font: inherit;
  padding: 8px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.open input:focus-visible, .open button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.open .problem { color: var(--accent); margin-top: 8px; }
.hint { color: var(--muted); font-size: 14px; }
.foot {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 16px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.foot a { color: var(--muted); }
