/* The desktop app's five colours, used the same way */
:root {
  --bg: #ffffff;
  --surface: #f3f3f3;
  --raised: #e9e9e9;
  --fg: #1a1a1a;
  --muted: #8a8a8a;
  --danger: #c0392b;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --surface: #1f1f1f;
    --raised: #292929;
    --fg: #e8e8e8;
    --muted: #8a8a8a;
    --danger: #e06c5e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }
.head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.link {
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.back { color: var(--fg); font-weight: 600; }
.when { font-size: 13px; color: var(--muted); }

/* sign in */
.gate { max-width: 320px; margin: 0 auto; padding: 18vh 16px 0; }
.gate .brand { margin-bottom: 16px; }
.gate input, .search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit; /* 16px, so phones do not zoom in on focus */
  outline: none;
}
.gate input:focus, .search:focus { border-color: var(--raised); }
.search::placeholder, .gate input::placeholder { color: var(--muted); }
.btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.error { margin: 8px 0 0; font-size: 14px; color: var(--danger); }

/* the list */
.search-form { margin-bottom: 8px; }
.notes { list-style: none; margin: 0 -10px; padding: 0; }
.notes li { margin-bottom: 2px; }
.notes li.last-pinned { margin-bottom: 12px; }
.notes a {
  display: block;
  padding: 10px;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.notes a:hover, .notes a:active { background: var(--surface); }
.n-title { display: flex; align-items: center; font-size: 15px; font-weight: 500; }
.n-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.n-pin {
  flex: none;
  width: 11px;
  height: 11px;
  margin-left: 6px;
  background: currentColor;
  opacity: .55;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 3H8v2h1v6l-3 3v2h5v6h2v-6h5v-2l-3-3V5h1z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 3H8v2h1v6l-3 3v2h5v6h2v-6h5v-2l-3-3V5h1z'/></svg>") center / contain no-repeat;
}
.n-meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.n-meta span { flex: none; }
.n-meta .n-snippet { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 24px 0; text-align: center; font-size: 14px; color: var(--muted); }

/* a note, styled like the desktop editor */
.note-title { margin: 8px 0 16px; font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.note { line-height: 1.65; overflow-wrap: break-word; }
.note img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 6px; }
.note p { margin: 0 0 1em; }
.note strike, .note s, .note del { color: var(--muted); }
.note pre {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13.5px;
  overflow-x: auto;
}
.note code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
.note blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 3px solid var(--raised); color: var(--muted); }
.note a { color: inherit; }
.note table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.note td, .note th { padding: 4px 8px; border: 1px solid var(--raised); }
.note hr { margin: 1.5em 0; border: none; border-top: 1px solid var(--raised); }
