@import url('/fonts/typography.css');

:root {
  color-scheme: dark;
  --background: #15140f;
  --card: #27251f;
  --text: #f6f4ef;
  --muted: #b6b2a9;
  --border: #47433a;
  --accent: #ff8a19;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}
*::-webkit-scrollbar {
  display: none;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 17px/1.65 var(--app-font-family);
}
main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
nav,
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
a:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
nav a:first-child {
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.draft {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  margin: 22px 0;
  border: 1px solid #674a29;
  border-radius: 18px;
  background: linear-gradient(135deg, #392b1c, #27251f);
  box-shadow:
    inset 0 1px 0 #ffffff0a,
    0 8px 24px #0000001f;
}
.draft strong {
  color: var(--accent);
}
.draft span {
  color: var(--muted);
  font-size: 16px;
}
article {
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, #2b2923, var(--card));
  box-shadow:
    inset 0 1px 0 #ffffff0a,
    0 12px 30px #00000024;
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-size: clamp(26px, 5vw, 38px);
  margin: 0 0 22px;
}
h2 {
  font-size: clamp(21px, 3.5vw, 27px);
  margin: 32px 0 16px;
}
h3 {
  font-size: 19px;
  margin-top: 26px;
}
p {
  margin: 16px 0;
}
article > :last-child {
  margin-bottom: 0;
}
code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--muted);
  font: 0.9em/1.5 var(--app-font-family);
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
}
table {
  border-collapse: collapse;
  min-width: 580px;
  width: 100%;
  font-size: 16px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  min-width: 150px;
}
th {
  color: var(--muted);
  background: #ffffff05;
}
tr:last-child td {
  border-bottom: 0;
}
.documents {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}
.document {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
  padding: 16px 18px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff04;
  text-decoration: none;
}
.document span:last-child {
  color: var(--accent);
  font-size: 28px;
  flex-shrink: 0;
}
.source,
footer {
  font-size: 16px;
  color: var(--muted);
}
footer {
  margin-top: 24px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --background: #f3f1ec;
    --card: #fffdf8;
    --text: #25231e;
    --muted: #666157;
    --border: #d6d1c8;
    --accent: #a74700;
  }
  article {
    background: linear-gradient(145deg, #fffefa, var(--card));
  }
  .draft {
    background: #fff2df;
    border-color: #d8b486;
  }
}
@media print {
  :root {
    color-scheme: light;
    --background: #fff;
    --card: #fff;
    --text: #000;
    --muted: #444;
    --border: #bbb;
    --accent: #000;
  }
  main {
    max-width: none;
    padding: 0;
  }
  nav,
  footer,
  .source {
    display: none;
  }
  article,
  .draft {
    background: #fff;
    box-shadow: none;
  }
  article {
    border: 0;
    padding: 0;
  }
  .table-scroll {
    overflow: visible;
  }
  table {
    min-width: 0;
    font-size: 12px;
  }
  th,
  td {
    min-width: 0;
  }
}
