:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e5e5e5;
  --link: #1a1a1a;
  --positive: #1a7f37;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --text: #e8e8e8;
    --text-muted: #9a9a9a;
    --border: #2a2a2e;
    --link: #e8e8e8;
    --positive: #3fb950;
  }
}

:root[data-theme="dark"] {
  --bg: #111113;
  --text: #e8e8e8;
  --text-muted: #9a9a9a;
  --border: #2a2a2e;
  --link: #e8e8e8;
  --positive: #3fb950;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 6rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--bg);
}

.site-header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.1rem;
  margin: 3rem 0 1rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p {
  margin: 0 0 1.1rem;
}

a {
  color: var(--link);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--link);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.lists {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lists li {
  border-bottom: 1px solid var(--border);
}

.lists li:last-child {
  border-bottom: none;
}

.lists a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.85rem 0;
  text-decoration: none;
}

.lists a:hover .lists-title {
  text-decoration: underline;
  text-decoration-color: var(--link);
}

.lists-title {
  font-weight: 600;
  text-decoration-color: var(--border);
}

.back-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.breadcrumb {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  margin: 0 0.4rem;
}

.coming-soon {
  color: var(--text-muted);
  font-style: italic;
}

.entries {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.entries li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.entries li:first-child {
  padding-top: 0;
}

.entries li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.entry-title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.entry-meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.entry-meta .positive {
  color: var(--positive);
  font-weight: 600;
}

.entry-desc {
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.formula {
  font-style: italic;
  color: var(--text-muted);
}

.subtitle {
  color: var(--text-muted);
  margin: -0.75rem 0 2rem;
}

main ul:not(.lists):not(.entries) {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}

main ul:not(.lists):not(.entries) li {
  margin-bottom: 0.35rem;
}

main ol:not(.numbered) {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}

main ol:not(.numbered) li {
  margin-bottom: 0.35rem;
}

.numbered {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
}

.numbered > li {
  margin-bottom: 1rem;
}

.numbered li > ul,
.numbered li > ol {
  margin: 0.5rem 0 0;
}

.entry-links a {
  margin-right: 1.2rem;
  font-size: 0.95rem;
}

.valuation-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
}

.valuation {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.valuation th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0 0.6rem 0.4rem 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.valuation td {
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}

.valuation tr:last-child td {
  border-bottom: none;
}

.valuation th:last-child,
.valuation td:last-child {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

.valuation td:last-child {
  color: var(--text);
  font-weight: 500;
}

.subhead {
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.compare-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.compare th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.compare td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
  white-space: nowrap;
}

.compare td:first-child {
  color: var(--text);
  font-weight: 600;
}
