/* Liver policy explainer - web version base styles.
 * Replaces the parts of Bootstrap the Shiny app relied on; the app's own look
 * comes from styles.css (copied from www/styles.css, shared with the Shiny app),
 * which is loaded after this file. */
:root { --teal: #0e7490; --ink: #1f2937; --border: #e5e7eb; --muted: #6b7280; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body { margin: 0; font-family: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 1rem; line-height: 1.5; color: var(--ink); background: #f6f8fa; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 600; }
h5 { font-size: 1.05rem; } h6 { font-size: .95rem; }
p { margin: 0 0 .9rem; }
ul, ol { margin: 0 0 .9rem; }
a { color: var(--teal); }
a:hover { color: #155e75; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
[hidden] { display: none !important; }
.mt-3 { margin-top: 1rem !important; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 2000; }
.skip-link:focus { left: .5rem; }
.noscript { padding: 2rem 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---- Pages and layout ---- */
.container-fluid { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 1rem; }
.page { display: none; padding-bottom: 1rem; }
.page.active { display: block; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; align-items: start; }
.cols > .col { min-width: 0; }
@media (min-width: 768px) { .cols { grid-template-columns: var(--cols); } }

/* ---- Navbar ---- */
.navbar { position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 76rem; margin: 0 auto; padding: .45rem 1rem; display: flex; align-items: center; flex-wrap: wrap; }
.navbar-brand { text-decoration: none; color: var(--ink); padding: .35rem 0; }
.navbar-brand:hover { color: var(--ink); }
.navbar-nav { list-style: none; margin: 0; padding: 0; display: flex; }
.navbar .nav-link { display: block; text-decoration: none; padding: .55rem .6rem; background: none; border: 0; font: inherit; cursor: pointer; }
.navbar-toggler { display: none; margin-left: auto; background: #fff; border: 1px solid var(--border); border-radius: .5rem; padding: .55rem .6rem; cursor: pointer; }
.toggler-bar { display: block; width: 1.25rem; height: 2px; background: #374151; margin: 4px 0; border-radius: 2px; }
.dropdown { position: relative; }
.dropdown-toggle::after { content: ""; display: inline-block; margin-left: .35rem; vertical-align: .2em; border-top: .3em solid; border-left: .3em solid transparent; border-right: .3em solid transparent; }
.dropdown-menu { display: none; list-style: none; margin: 0; padding: .35rem 0; }
.dropdown-menu.show { display: block; }
@media (min-width: 992px) {
  .navbar-collapse { display: flex !important; margin-left: auto; }
  .navbar-nav { flex-direction: row; align-items: center; }
  .dropdown-menu { position: absolute; right: 0; top: 100%; min-width: 12rem; background: #fff; border: 1px solid var(--border); border-radius: .6rem; box-shadow: 0 6px 20px rgba(15, 23, 42, .1); }
  .dropdown-item { padding: .5rem 1rem !important; }
}
@media (max-width: 991.98px) {
  .navbar-toggler { display: block; }
  .navbar-collapse { display: none; width: 100%; }
  .navbar-collapse.show { display: block; }
  .navbar-nav { flex-direction: column; padding-top: .25rem; }
  .navbar .dropdown-toggle { width: 100%; text-align: left; }
}

/* ---- Cards ---- */
.card { background: #fff; border: 1px solid var(--border); border-radius: .75rem; margin-bottom: 1rem; min-width: 0; }
.card-header { padding: .75rem 1rem; font-weight: 600; border-bottom: 1px solid var(--border); border-radius: .75rem .75rem 0 0; }
.card-body { padding: 1rem; }
.card-body > :last-child, .tab-pane > :last-child { margin-bottom: 0; }
.card-header.hdr { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }

/* ---- Tabs ---- */
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.nav .nav-link { display: block; text-decoration: none; color: #4b5563; padding: .45rem .8rem; border-radius: .5rem; }
.nav-underline { gap: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.nav-underline .nav-link { padding: .5rem .1rem; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav-underline .nav-link.active { color: var(--ink); border-bottom-color: currentColor; font-weight: 600; }
.card-header .nav-underline { border-bottom: 0; margin: -.75rem 0; }
.card-header .nav-underline .nav-link { padding: .8rem .1rem; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- Accordion (details) ---- */
.accordion { border: 1px solid var(--border); border-radius: .75rem; background: #fff; margin-bottom: 1rem; }
.accordion-item + .accordion-item { border-top: 1px solid var(--border); }
.accordion-button { cursor: pointer; padding: .9rem 1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.accordion-button::-webkit-details-marker { display: none; }
.accordion-button::after { content: "+"; color: var(--teal); font-weight: 700; }
.accordion-item[open] > .accordion-button::after { content: "\2212"; }
.accordion-body { padding: 0 1rem 1rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: .6rem; }
.control-label { display: inline-block; font-size: .85rem; margin-bottom: .15rem; }
.form-control, .form-select { display: block; width: 100%; padding: .4rem .6rem; font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid #cbd5e1; border-radius: .4rem; }
.form-control:focus, .form-select:focus { border-color: var(--teal); outline: 2px solid rgba(14, 116, 144, .25); outline-offset: 0; }
.form-check { margin-bottom: .3rem; }
.form-check label, .checkbox label { display: flex; gap: .5rem; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.form-check-input { margin: .2rem 0 0; flex: 0 0 auto; width: 1rem; height: 1rem; accent-color: var(--teal); }
.shiny-options-group.inline { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.btn { display: inline-block; font: inherit; font-weight: 500; line-height: 1.5; text-decoration: none; cursor: pointer; padding: .45rem .9rem; border-radius: .45rem; border: 1px solid transparent; }
.btn-sm { font-size: .875rem; padding: .3rem .7rem; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: #155e75; color: #fff; }
.btn-outline-primary { color: var(--teal); border-color: var(--teal); background: #fff; }
.btn-outline-primary:hover { background: var(--teal); color: #fff; }
.btn-outline-secondary { color: #4b5563; border-color: #9ca3af; background: #fff; }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.table th, .table td { padding: .4rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-weight: 600; }
.table-striped tbody tr:nth-child(odd) td { background: #f8fafc; }

/* ---- Misc from the Shiny pages ---- */
.flow-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.block-heading { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.output:empty { display: none; }
@media (max-width: 767.98px) {
  .container-fluid { padding: 0 .75rem; }
  .nav-inner { padding: .4rem .75rem; }
}
