/* The look of the CMS: the system's font, a light and a dark look that follow the system, and calm tables. */

:root {
  color-scheme: light dark;
  --page: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --separator: #d2d2d7;
  --hairline: #e8e8ed;
  --link: #0066cc;
  --accent: #0071e3;
  --fill: rgba(0, 0, 0, 0.05);
  --selected: #ffffff;
  --red: #d70015;
  --raised: #ffffff;
  /* The charts: one series, a hairline grid, and a track a step lighter than the series. */
  --series: #257de0;
  --track: #cce3fd;
  --grid: #e7e7e7;
  --axis: #c2c2c2;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #98989d;
    --separator: #38383a;
    --hairline: #2c2c2e;
    --link: #2997ff;
    --accent: #0a84ff;
    --fill: rgba(255, 255, 255, 0.08);
    --selected: #636366;
    --red: #ff453a;
    --raised: #2c2c2e;
    --series: #338ced;
    --track: #0e3d7e;
    --grid: #303030;
    --axis: #474747;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.47 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0; }

/* The bar at the top: the name, the pages and Sign out. */
.bar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.bar-in { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; min-height: 52px; }
.name { color: var(--ink); font-weight: 600; font-size: 17px; }
.name:hover { text-decoration: none; }
.bar nav { display: flex; gap: 20px; font-size: 14px; }
.bar nav a { color: var(--ink-2); white-space: nowrap; }
.bar nav a[aria-current="page"] { color: var(--ink); }
.bar form { margin-left: auto; }

main { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }
main[aria-busy="true"] { opacity: 0.5; transition: opacity 0.15s ease 0.15s; }

/* A view: its title, the filters under it, then its cards. */
.head { margin-bottom: 18px; display: grid; gap: 12px; justify-items: start; }
.head .quiet-text { margin-top: -6px; }
.back { display: inline-block; margin-bottom: 6px; font-size: 14px; }
.card { background: var(--surface); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; min-width: 0; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.quiet-text { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.empty { color: var(--ink-2); padding: 20px 0; text-align: center; }
.error { color: var(--red); }

/* Lists. A row that opens something has its link in the first cell, and a click anywhere on it follows the link. */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 0 16px 8px 0; border-bottom: 1px solid var(--separator); white-space: nowrap; }
td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; overflow-wrap: anywhere; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: normal; }
.nowrap { white-space: nowrap; overflow-wrap: normal; }
.text { white-space: pre-wrap; }
tr.opens { cursor: pointer; }
tr.opens:hover td:first-child a { text-decoration: underline; }

/* Choices of one: the period, or which feedback to show. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented > a, .segmented > button {
  border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500;
  padding: 4px 12px; border-radius: 7px; cursor: pointer; text-decoration: none;
}
.segmented > [aria-current="true"], .segmented > [aria-pressed="true"] {
  background: var(--selected);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.segmented > button:disabled { cursor: default; }

.pager { display: flex; justify-content: flex-end; gap: 20px; font-size: 14px; }

button.quiet { border: 0; background: none; color: var(--link); font: inherit; font-size: 14px; padding: 6px 0; cursor: pointer; }
button.primary { border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 500; padding: 9px 16px; cursor: pointer; }

/* The chart of users per day, and the bars of shares and uses. */
.chart { position: relative; height: 220px; margin: 4px 0 8px; touch-action: pan-y; }
.chart:focus-visible { outline-offset: 6px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis, .chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series); fill-opacity: 0.1; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.tip {
  position: absolute; top: 0; pointer-events: none; white-space: nowrap;
  background: var(--raised); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--ink-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
.tip strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
details { margin-top: 4px; font-size: 14px; }
summary { cursor: pointer; color: var(--link); width: max-content; }
details[open] summary { margin-bottom: 8px; }
td.bars { width: 50%; }
.share { display: flex; align-items: center; gap: 12px; }
.share span { min-width: 4em; text-align: right; font-variant-numeric: tabular-nums; }
.meter { flex: 1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; min-width: 40px; }
.meter > div { height: 100%; border-radius: 3px; background: var(--series); }
.note { margin: -4px 0 16px; }

/* One crash report: its facts, and the report as it came. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
pre.report { margin: 0; font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Feedback: its two filters side by side, what a person wrote, its kind and its status. */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.message { margin-bottom: 4px; }
td .segmented { flex-wrap: nowrap; }
td .segmented + .error { margin-top: 6px; max-width: 220px; }
td .segmented + .error:empty { display: none; }

/* The kind of each event of the log, and of each feedback message. */
.kind { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 6px; background: var(--fill); white-space: nowrap; }

/* The login page. */
body.login main { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
body.login .card { width: min(360px, 100%); display: grid; gap: 10px; padding: 28px; margin: 0; }
body.login h1 { font-size: 24px; }
label { font-size: 13px; font-weight: 500; margin-top: 8px; }
input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--separator); border-radius: 8px; padding: 9px 12px;
}
.wrong { color: var(--red); }

@media (max-width: 640px) {
  .bar-in { flex-wrap: wrap; gap: 0 16px; padding: 0 16px; }
  .bar nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 10px; }
  main { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .card { padding: 14px 16px; }
  /* Columns that a phone leaves out: what they say is on the page that a row opens. */
  .wide { display: none; }
  td .segmented { flex-direction: column; }
}
