:root {
  color-scheme: light;
  --austria-red: #c8102e;
  --bg: #ffffff;
  --text: #1c1c1c;
  --muted: #5f5f5f;
  --border: #e6e6e6;
  --hover: #f6f6f6;
  --callout: #f7f7f7;
  --mark: #f3e3a0;
  --mark-text: #1c1c1c;
  --content-max: 56rem;
  --bs-body-bg: #ffffff;
  --bs-body-color: #1c1c1c;
  --bs-emphasis-color: #1c1c1c;
  --bs-border-color: #e6e6e6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121212;
    --text: #f3f3f3;
    --muted: #b5b5b5;
    --border: #2e2e2e;
    --hover: #1c1c1c;
    --callout: #1a1a1a;
    --mark: #6d5a22;
    --mark-text: #fff8e1;
    --bs-body-bg: #121212;
    --bs-body-color: #f3f3f3;
    --bs-emphasis-color: #f3f3f3;
    --bs-border-color: #2e2e2e;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --text: #f3f3f3;
  --muted: #b5b5b5;
  --border: #2e2e2e;
  --hover: #1c1c1c;
  --callout: #1a1a1a;
  --mark: #6d5a22;
  --mark-text: #fff8e1;
  --bs-body-bg: #121212;
  --bs-body-color: #f3f3f3;
  --bs-emphasis-color: #f3f3f3;
  --bs-border-color: #2e2e2e;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1c1c1c;
  --muted: #5f5f5f;
  --border: #e6e6e6;
  --hover: #f6f6f6;
  --callout: #f7f7f7;
  --mark: #f3e3a0;
  --mark-text: #1c1c1c;
  --bs-body-bg: #ffffff;
  --bs-body-color: #1c1c1c;
  --bs-emphasis-color: #1c1c1c;
  --bs-border-color: #e6e6e6;
}

html {
  height: 100%;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
}

.content-shell {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 1.75rem);
}

.site-main {
  flex: 1 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  padding-inline: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 50;
  background: var(--text);
  color: var(--bg);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

::selection {
  background: var(--mark);
  color: var(--mark-text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
}

/* Keep in-page jumps flush under the sticky header (Notion-style). */
h2[id],
h3[id],
.faq-section[id],
#authors {
  scroll-margin-top: 4.75rem;
}

.site-nav {
  display: block;
  background: var(--bg);
  border-top: 2px solid var(--austria-red);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
}

.nav-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-height: 44px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 auto 0 0;
  padding: 0;
  min-height: 40px;
  line-height: 1;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: var(--text);
}

.brand-mark {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--austria-red);
}

.brand-name {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding-top: 0.05em;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-mark {
    color: #ffffff;
  }
}

:root[data-theme="dark"] .brand-mark {
  color: #ffffff;
}

:root[data-theme="light"] .brand-mark {
  color: var(--austria-red);
}

.mention-icon {
  display: block;
  flex: none;
}

.navbar-toggler {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.navbar-toggler-bars {
  width: 16px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  justify-content: flex-end;
}

.search-shell {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 18rem;
}

@media (min-width: 992px) {
  .search-shell {
    max-width: 28rem;
    flex: 1 1 28rem;
  }
}

@media (min-width: 1200px) {
  .search-shell {
    max-width: 34rem;
    flex: 1 1 34rem;
  }
}

.search-form {
  margin: 0;
}

.search-input {
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  box-shadow: none;
  width: 100%;
}

.site-nav .search-input {
  width: 100%;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px color-mix(in srgb, #000 12%, transparent);
  overflow: hidden;
  padding: 0.35rem;
}

.search-suggest[hidden] {
  display: none !important;
}

.search-suggest a,
.search-suggest .search-more {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  border: 0;
  background: transparent;
  text-align: left;
}

.search-suggest a:hover,
.search-suggest .search-more:hover {
  background: var(--hover);
}

.search-suggest .suggest-section {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.1rem;
}

.search-suggest .suggest-title {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}

.search-suggest .search-more {
  color: var(--austria-red);
  font-weight: 600;
  font-size: 0.92rem;
}

.search-suggest .suggest-empty {
  margin: 0;
  padding: 0.7rem 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: var(--text);
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--hover);
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="light"] .icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-moon {
  display: block;
}

@media (min-width: 992px) {
  .navbar-toggler {
    display: none;
  }

  #site-menu {
    display: flex !important;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
  }

  .nav-tools {
    width: auto;
  }
}

@media (max-width: 991.98px) {
  #site-menu {
    flex-basis: 100%;
    padding-top: 0.55rem;
  }

  #site-menu.show {
    display: block;
  }

  .nav-tools {
    width: 100%;
  }

  .search-shell {
    max-width: none;
  }

  .theme-toggle {
    flex: none;
  }
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: clamp(1.55rem, 4.5vw, 2.35rem);
  margin: 0 0 1.1rem;
}

.article-published {
  margin: -0.55rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.article-published time {
  font-variant-numeric: tabular-nums;
}

h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  margin: 2.1rem 0 0.7rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.45rem;
}

h2 strong,
h3 strong,
.toc strong {
  font-weight: inherit;
}

article {
  overflow-wrap: anywhere;
}

.crumbs {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.crumbs a {
  color: inherit;
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs span {
  margin: 0 0.3rem;
}

.article-body p,
.content p {
  margin: 0 0 0.95rem;
}

.article-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

.article-body a:hover {
  text-decoration-color: currentColor;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.article-body li {
  margin: 0.3rem 0;
}

.article-body li > ul,
.article-body li > ol {
  margin-bottom: 0.25rem;
}

.toc {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 1.5rem;
  overflow: hidden;
  background: var(--bg);
}

.toc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.toc-toggle:hover {
  background: var(--hover);
}

.toc-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.toc-chevron {
  flex: none;
  transition: transform 0.2s ease;
}

.toc-toggle:not(.collapsed) .toc-chevron {
  transform: rotate(180deg);
}

.toc-list {
  margin: 0;
  padding: 0 1rem 0.9rem 2.1rem;
}

.toc-list li {
  margin: 0.28rem 0;
}

.toc-list a {
  color: inherit;
  text-decoration: none;
}

.toc-list a:hover {
  text-decoration: underline;
}

.toc + .article-body > h2:first-child {
  margin-top: 0;
}

.callout {
  background: var(--callout);
  border-left: 3px solid var(--text);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1rem;
  margin: 0 0 1.1rem;
}

.callout p {
  margin: 0;
}

.callout u {
  text-decoration: none;
}

u {
  text-underline-offset: 0.15em;
}

.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  column-gap: 0.7rem;
  align-items: start;
  margin: 0.45rem 0;
}

.checklist input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.4rem;
  accent-color: var(--austria-red);
}

.checklist input:checked + .check-body .check-text {
  color: var(--muted);
  text-decoration: line-through;
}

.guide-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.15rem auto 1.3rem;
  text-align: center;
}

.guide-figure img {
  display: block;
  /* Use full content width so HTML width/height attrs can reserve
     aspect-ratio before lazy images decode; otherwise hash jumps
     undershoot (e.g. FAQ landing on Anggaran). */
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.guide-figure figcaption {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  margin-top: 0.5rem;
  max-width: 40rem;
}

.page-mention {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  margin: 0.45rem 0;
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}

.page-mention:hover {
  background: var(--hover);
  text-decoration: none;
}

.faq-nav {
  margin: 1rem 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.faq-nav .accordion-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.faq-nav .accordion-item:last-child {
  border-bottom: 0;
}

.faq-nav .accordion-header {
  margin: 0;
}

.faq-toggle {
  width: 100%;
  min-height: 52px;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--text);
  box-shadow: none !important;
  font-size: 1rem;
  font-weight: 600;
}

.faq-toggle:not(.collapsed) {
  background: var(--hover);
  color: var(--text);
}

.faq-toggle:focus {
  box-shadow: none !important;
}

.faq-toggle::after {
  filter: none;
  background-image: none;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.35rem;
  opacity: 0.7;
}

.faq-toggle:not(.collapsed)::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.faq-section-title {
  flex: 1;
  text-align: left;
}

.faq-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--austria-red) 12%, transparent);
  color: var(--austria-red);
  font-size: 0.8rem;
  font-weight: 700;
}

.faq-body {
  padding: 0.35rem 0.85rem 0.85rem;
}

.faq-empty {
  margin: 0.35rem 0;
  color: var(--muted);
}

.faq-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.faq-page-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
}

.faq-page-btn:hover:not(:disabled) {
  background: var(--hover);
}

.faq-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.faq-page-status {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.file-download {
  margin: 0.8rem 0 1rem;
}

.file-download a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
}

.file-download a:hover {
  background: var(--hover);
}

.file-name {
  overflow-wrap: anywhere;
}

.file-size {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.search-page-form {
  margin: 0 0 0.5rem;
}

.search-page-form .search-input {
  width: 100%;
}

#search-status {
  color: var(--muted);
  min-height: 1.5rem;
  margin: 0.4rem 0 0.2rem;
}

.guide-index h2 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.2rem;
}

.guide-index ul,
.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-index a,
.result-list a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.guide-index a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.guide-index time {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.result-section {
  color: var(--muted);
  font-size: 0.8rem;
}

.result-title {
  display: block;
  font-weight: 600;
  margin: 0.1rem 0 0.15rem;
}

.result-snippet {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

mark {
  background: var(--mark);
  color: var(--mark-text);
  padding: 0 0.12em;
  border-radius: 2px;
}

.authors {
  margin-top: 0.5rem;
}

.authors-grid {
  display: grid;
  gap: 1rem;
}

.author-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: var(--bg);
  box-shadow: 0 1px 0 color-mix(in srgb, #000 4%, transparent);
}

.author-photo {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--border);
}

.author-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.author-name {
  margin: 0.1rem 0 0.1rem;
  font-size: 1.1rem;
}

.article-body .author-role,
.author-role {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-body .author-actions,
.author-actions {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
}

.article-body .author-actions li,
.author-actions li {
  margin: 0;
  padding: 0;
}

.author-icon-link {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
}

.author-icon-link:hover {
  background: var(--hover);
  color: var(--austria-red);
  text-decoration: none;
}

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  min-height: 2rem;
}

.footer-updated,
.license-text {
  margin: 0;
  line-height: 1.3;
}

.footer-license {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.license-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  line-height: 0;
}

.license-badge img {
  display: block;
  height: 22px;
  width: auto;
}

.license-text {
  margin: 0;
  max-width: none;
  line-height: 1.3;
  text-align: right;
}

.license-text a {
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--hover);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .site-main {
    padding-top: 1.15rem;
  }

  .guide-index a {
    flex-direction: column;
    gap: 0.1rem;
  }

  .file-download a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .page-mention {
    align-items: flex-start;
  }

  .author-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .author-actions {
    justify-content: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-license {
    display: block;
    width: 100%;
  }

  .license-badge {
    display: none;
  }

  .license-text {
    text-align: left;
  }

  .faq-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (min-width: 1200px) {
  :root {
    --content-max: 64rem;
  }
}

@media print {
  .site-nav,
  .skip-link,
  .toc,
  .theme-toggle,
  .faq-nav .accordion-button::after {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  a {
    text-decoration: underline;
  }

  .faq-nav .collapse {
    display: block !important;
    height: auto !important;
  }
}
