/* iOS Settings — system grouped lists (Apple HIG / UIKit). */

:root {
  --grouped-bg: #F2F2F7;
  --cell: #FFFFFF;
  --tertiary: #2C2C2E;
  --label: #000000;
  --secondary: rgba(60, 60, 67, 0.60);
  --tertiary-label: rgba(60, 60, 67, 0.30);
  --separator: rgba(60, 60, 67, 0.29);
  --fill: rgba(120, 120, 128, 0.20);
  --fill-secondary: rgba(120, 120, 128, 0.16);
  --nav: rgba(242, 242, 247, 0.86);
  --thumb: #FFFFFF;
  --tint: #007AFF;
  --green: #34C759;
  --orange: #FF9500;
  --red: #FF3B30;
  --gray: #8E8E93;
  --blue: #007AFF;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grouped-bg: #000000;
    --cell: #1C1C1E;
    --tertiary: #2C2C2E;
    --label: #FFFFFF;
    --secondary: rgba(235, 235, 245, 0.60);
    --tertiary-label: rgba(235, 235, 245, 0.30);
    --separator: rgba(84, 84, 88, 0.65);
    --fill: rgba(120, 120, 128, 0.36);
    --fill-secondary: rgba(120, 120, 128, 0.32);
    --nav: rgba(0, 0, 0, 0.72);
    --thumb: #2C2C2E;
    --tint: #0A84FF;
    --green: #30D158;
    --orange: #FF9F0A;
    --red: #FF453A;
    --gray: #8E8E93;
    --blue: #0A84FF;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--grouped-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--label);
  background: var(--grouped-bg);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden],
.is-hidden { display: none !important; }

.book {
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--grouped-bg);
  border: none;
  box-shadow: none;
}

.wrap {
  max-width: 428px;
  margin: 0 auto;
  padding: 0 0 calc(28px + env(safe-area-inset-bottom, 0px));
  color: var(--label);
  background: var(--grouped-bg);
  border: none;
  box-shadow: none;
}

/* Sticky navigation bar */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 10px;
  color: var(--label);
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: none;
  border-bottom: 0.5px solid var(--separator);
  box-shadow: none;
}

.app-kicker {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--secondary);
}

.app-title {
  margin: 2px 0 10px;
  padding: 0;
  border: none;
  font-family: var(--font);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.4px;
  color: var(--label);
}

.app-search { display: block; }

.app-bar input[type="search"] {
  display: block;
  width: 100%;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px 0 32px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 36px;
  color: var(--label);
  background-color: var(--fill);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238E8E93' stroke-width='1.8' stroke-linecap='round'><circle cx='6.6' cy='6.6' r='5'/><path d='M10.4 10.4 14 14'/></svg>");
  background-repeat: no-repeat;
  background-position: 10px 50%;
  background-size: 16px 16px;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.app-bar input[type="search"]::placeholder {
  color: var(--secondary);
  opacity: 1;
}

.app-bar input[type="search"]::-webkit-search-decoration,
.app-bar input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.app-bar input[type="search"]:focus {
  outline: none;
}

/* Segmented control */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 10px 0 0;
  padding: 2px;
  background: var(--fill-secondary);
  border-radius: 9px;
}

.chip {
  flex: 1 1 calc(33.333% - 2px);
  min-width: 0;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 28px;
  color: var(--secondary);
  background: transparent;
  border: none;
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
}

.chip.is-on,
.chip.is-on.PROVEN,
.chip.is-on.PARTIAL,
.chip.is-on.UNREAD,
.chip.is-on.DISPROVEN,
.chip.is-on.TEMPORARY {
  color: var(--label);
  background: var(--thumb);
  border: none;
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chip:focus-visible {
  outline: none;
}

.hits {
  margin: 8px 0 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--secondary);
}

/* Intro: grouped footer footnote */

header.doc-intro {
  margin: 8px 32px 8px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

header.doc-intro h1,
header.doc-intro .kicker,
header.doc-intro .muted {
  display: none;
}

header.doc-intro p {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--secondary);
}

/* Section headers */

h2,
h3 {
  margin: 24px 0 6px;
  padding: 0 0 0 32px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  color: var(--secondary);
}

h2::before,
h2::after,
h3::before,
h3::after {
  display: none;
  content: none;
}

.wrap > p,
.wrap > ol,
.wrap > ul {
  margin: 0 32px 12px;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--secondary);
}

.wrap > ol,
.wrap > ul.plain {
  padding-left: 1.15em;
}

.wrap > p + p,
.wrap > ol + p,
.wrap > ul + p {
  margin-top: 8px;
}

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

a {
  color: var(--tint);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover { text-decoration: none; }

a:focus-visible {
  outline: none;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--label);
  background: var(--fill);
  padding: 0.08em 0.32em;
  border-radius: 4px;
  border: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (prefers-color-scheme: dark) {
  code,
  .mono {
    background: var(--tertiary);
  }
}

p, li, td, th, code, a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

nav.toc {
  display: none !important;
}

/* Inset grouped lists */

.table-scroll {
  overflow: visible;
  max-width: 100%;
  margin: 8px 16px 16px;
}

.table-scroll table,
.table-scroll thead,
.table-scroll tbody,
.table-scroll tfoot {
  display: block;
  width: 100%;
}

.table-scroll thead { display: none; }

.table-scroll table {
  margin: 0;
  background: var(--cell);
  border: none;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: none;
}

.table-scroll tbody {
  background: transparent;
}

.table-scroll tr {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  position: relative;
  margin: 0;
  padding: 11px 16px;
  min-height: 44px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.table-scroll tbody tr:not([hidden]):not(.is-hidden)::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--separator);
  pointer-events: none;
}

.table-scroll tbody tr:not([hidden]):not(.is-hidden):not(:has(+ tr:not([hidden]):not(.is-hidden)))::after {
  display: none;
}

.table-scroll th,
.table-scroll td {
  display: block;
  width: auto;
  max-width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-scroll td:first-child {
  grid-column: 1;
  grid-row: 1;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--label);
}

.table-scroll td:has(.badge):not(:first-child) {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  text-align: right;
  width: auto;
  padding: 0;
}

.table-scroll td:not(:first-child):not(:has(.badge)) {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--secondary);
}

.table-scroll tr:has(> td:first-child .badge) > td:first-child {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  text-align: right;
  width: auto;
}

.table-scroll tr:has(> td:first-child .badge) > td:not(:first-child) {
  grid-column: 1;
  grid-row: 1;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--label);
}

.badge {
  display: inline-block;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  border: none;
  box-shadow: none;
  vertical-align: middle;
}

.badge.PROVEN {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 18%, transparent);
}

.badge.PARTIAL {
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 18%, transparent);
}

.badge.UNREAD,
.badge.N-A {
  color: var(--gray);
  background: color-mix(in srgb, var(--gray) 22%, transparent);
}

.badge.DISPROVEN {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 18%, transparent);
}

.badge.TEMPORARY {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 18%, transparent);
}

.callout {
  margin: 8px 16px 16px;
  padding: 11px 16px;
  background: var(--cell);
  border: none;
  border-radius: 12px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--secondary);
}

.callout strong {
  color: var(--label);
  font-weight: 600;
}

ul.plain li,
ol li { margin: 0.28em 0; }

footer {
  margin: 16px 32px 0;
  padding-top: 12px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 0.5px solid var(--separator);
  box-shadow: none;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
