/* Portal: the one style sheet (design 6: no browser code on the pages, so everything is here).
   Phone first: one column, and every target a finger can hit is at least 44 by 44 pixels. */
:root {
  color-scheme: light;
  --ink: #1d2733;
  --muted: #5b6777;
  --line: #d5dce5;
  --paper: #ffffff;
  --ground: #f3f5f8;
  --accent: #0b5cad;
  --soft: #e8eff8;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.top h1, .top p { margin: 0; font-size: 1.1rem; font-weight: 600; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }

h1 { margin: 8px 0 16px; font-size: 1.35rem; }
h2 { margin: 20px 0 10px; font-size: 1.1rem; }

/* Links that are targets: never smaller than 44 by 44 */
a { color: var(--accent); }

a.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  font-weight: 600;
  text-decoration: none;
}

nav.menu { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 12px; }

nav.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.tiles, .entries { display: flex; flex-direction: column; gap: 12px; }

a.tile, a.report-link {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tile-title { display: block; font-weight: 600; }

.report-link .stock { display: block; font-weight: 600; }
.report-link .facts { display: block; margin-top: 4px; color: var(--muted); }
.report-link .facts > span { display: inline-block; margin: 2px 14px 2px 0; }

.badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 600;
}

.sign-out { margin: 0; }

button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  font: inherit;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.error main { padding-top: 48px; }

/* The sign-in pages (the login page, the waiting page, the invitation page, the add-passkey page): one column,
   and every field, button and link a finger can hit is at least 44 by 44 pixels (design 5.1). */
[hidden] { display: none !important; }

.sign-in main, .signed-in main { max-width: 440px; }

.sign-in .stack, .signed-in .stack { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }

.sign-in .stack label, .signed-in .stack label {
  margin-top: 10px;
  font-weight: 600;
}

.stack input:not([type="hidden"]) {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.sign-in button, .signed-in button { width: 100%; min-height: 48px; margin-top: 14px; }

.sign-in a, .signed-in a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 48px;
}

.message { color: var(--muted); }

.plain-list { margin: 0; padding-left: 20px; }

/* The account page (slice 3): one column; every link and button at least 44 by 44; a long browser name never widens the page. */
.account section {
  margin-top: 12px;
  padding: 4px 16px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.account section > h2 { margin: 12px 0 4px; }

.account .note, .account .empty { margin: 4px 0; color: var(--muted); }

.account .add-passkey { margin: 4px 0 8px; }

.account a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.account li { padding: 4px 0 0; overflow-wrap: anywhere; }

.account li form { margin: 0 0 8px; }

.account .this-one { font-weight: 600; color: var(--accent); }

/* The admin pages (slice 3): a list, a person with a switch and the apps a member may open; every link, button and select at least 44 by 44. */

/* The invitations, the apps and the audit log (gate 3D): the one-time link, the fields of a form, and the cursor of the log. */
.admin .link {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.admin form label { display: block; margin: 8px 0 2px; }

.admin input[type="text"] { width: 100%; min-height: 44px; padding: 6px 8px; font: inherit; }

.admin .tick { display: flex; align-items: center; gap: 8px; min-height: 44px; }

.admin .tick input { width: 24px; height: 24px; }

.admin .older, .admin .newest { display: inline-flex; align-items: center; }
.admin .links { list-style: none; margin: 8px 0; padding: 0; }

.admin .links li { margin: 4px 0; }

.admin section {
  margin-top: 12px;
  padding: 4px 16px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin section > h2 { margin: 12px 0 4px; }

.admin a, .admin button, .admin select {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.admin li { padding: 4px 0 0; overflow-wrap: anywhere; }

.admin li form { margin: 0 0 8px; }

.admin .fields { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 4px 0; }

.admin .fields dt { color: var(--muted); }

.admin .fields dd { margin: 0; overflow-wrap: anywhere; }

.admin .error { margin: 4px 0; font-weight: 600; color: var(--accent); }

.admin .note, .admin .off { color: var(--muted); }

.admin .you { font-weight: 600; color: var(--accent); }
