/* My Diary - privacy policy
   Self-contained: no web fonts, no CDN, so it renders identically in an in-app WebView
   and offline. */

:root {
  /* Light only, deliberately: the app has no dark theme, so a page that flipped to dark
     on a dark-mode phone would look like it belonged to a different product. The
     color-scheme declaration is what stops the browser (and Android's auto-dark for web
     content) from inverting it for us. */
  color-scheme: light;

  --accent: #6D7DB5;          /* matches the app's DarkBlue theme */
  --accent-soft: #eef0f8;
  --ink: #1f2430;
  --ink-soft: #5a6272;
  --rule: #e3e6ee;
  --page: #ffffff;
  --shell: #f6f7fb;
  --ok: #2e7d52;
  --no: #b3453f;
  --maxw: 1040px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  background: var(--accent);
  color: #fff;
  padding: 40px 0 32px;
}

.masthead .eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}

.masthead h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.15;
  font-weight: 700;
}

.dates {
  margin: 0;
  font-size: 14px;
  opacity: .9;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

/* ------------------------------------------------------------------ layout */

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 32px;
  padding-bottom: 64px;
}

main {
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 8px 32px 32px;
  min-width: 0;
}

/* --------------------------------------------------------------------- toc */

.toc {
  position: sticky;
  top: 24px;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 20px;
}

.toc-toggle {
  display: none;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li { counter-increment: toc; }

.toc a {
  display: block;
  padding: 6px 0 6px 26px;
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
}

.toc li:not(:first-child) a::before {
  content: counter(toc) ".";
  position: absolute;
  left: 4px;
  opacity: .6;
  font-variant-numeric: tabular-nums;
}

.toc a:hover { color: var(--accent); }

.toc a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ---------------------------------------------------------------- sections */

section { scroll-margin-top: 20px; }

section + section {
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

h2 {
  font-size: 21px;
  line-height: 1.3;
  margin: 28px 0 12px;
}

h3 {
  font-size: 16px;
  margin: 24px 0 8px;
  color: var(--accent);
}

p { margin: 0 0 14px; }

ul { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }

a { color: var(--accent); }

code {
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .88em;
  word-break: break-word;
}

/* ---------------------------------------------------------------- callouts */

.callout {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 4px 24px 20px;
  margin-top: 24px;
}

.callout h2 { margin-top: 20px; }

.ticks, .crosses { list-style: none; padding-left: 0; }

.ticks li, .crosses li {
  padding-left: 28px;
  position: relative;
}

.ticks li::before {
  content: "\2713";
  position: absolute;
  left: 4px;
  color: var(--ok);
  font-weight: 700;
}

.crosses li::before {
  content: "\00d7";
  position: absolute;
  left: 4px;
  color: var(--no);
  font-weight: 700;
  font-size: 1.2em;
  line-height: 1.3;
}

.note {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--ink-soft);
}

.contact-block {
  font-size: 18px;
  font-weight: 600;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-radius: 10px;
  word-break: break-word;
}

/* ------------------------------------------------------------------ tables */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 14.5px;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  background: var(--accent-soft);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ footer */

.foot {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------- back to top */

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

.to-top[hidden] { display: none; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 18px;
  }

  main { padding: 4px 20px 24px; }

  .toc { position: static; }

  .toc-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .toc-toggle::after {
    content: "\25be";
    transition: transform .15s ease;
  }

  .toc-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

  /* Collapsed by default on small screens; script.js sets the initial state so
     the list stays visible when JavaScript is unavailable. */
  .toc ol.collapsed { display: none; }

  .toc ol { margin-top: 12px; }
}

/* ------------------------------------------------------------------- print */

@media print {
  body { background: #fff; color: #000; }
  .toc, .to-top { display: none; }
  .layout { display: block; padding: 0; }
  main { border: 0; padding: 0; }
  .masthead { background: #fff; color: #000; padding-bottom: 12px; }
  a { color: #000; text-decoration: underline; }
  section + section { page-break-inside: avoid; }
}