:root{
  --bg:#fff;
  --surface:#fff;
  --surface-2:#f6f7f9;
  --border:#e6e7ea;
  --text:#111318;
  --muted:#5b6372;
  --mobile-nav-label: #333;
  --brand:#111318;
  --brand-soft:#f6f7f9;
  --link:rgb(135, 94, 41);
  --link-hover:rgb(135, 94, 41);
  --radius:8px;
  --shadow:0 1px 2px rgba(16,24,40,.06), 0 2px 10px rgba(16,24,40,.06);
  --navw:360px;
  --header-h: 40px;
  --optical-nudge: -2px;
}

*{ box-sizing:border-box; }
html, body{ 
  height:100%; 
}
body{ 
  margin:0; 
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; 
  color:var(--text); 
  background:var(--bg); 
  overflow: hidden;
  min-height: 0;
}

/* Header */
.header {
  background-color: #212529;
  height: var(--header-h);
}

.header-inner {
  max-width: 100%;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.header-inner h1 {
  margin: 0;
  line-height: 1;
  font-size: 1.5rem;
  font-family: Georgia, serif;
  color: #FFF;
  font-weight: 400;
  display: none;                /* desktop: dold */
  transform: translateY(var(--optical-nudge));
}

.sub{ margin:6px 0 0; color:var(--muted); font-size:.95rem; }

.lang-switch {
  margin-left: auto;
  font-size: 0.9rem;
  line-height: 1;
}

a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  height: var(--header-h);
  line-height: 1;
  color: #FFF;
  font-size: 16px;
  transform: translateY(var(--optical-nudge));
}

.lang-switch a:hover {
  color: #FFF;
}

/* Layout */
.layout{
  height: calc(100vh - (var(--header-h)));
  display:grid;
  grid-template-columns: var(--navw) 1fr;
  min-height:0;
  width: 100%;
  max-width: 1400px;
  margin: auto;
}
@media (max-width: 1400px) {
  .layout {
    padding-inline: 0.6em;
  }
}
@media (max-width: 960px) {
  .layout {
    padding-inline: 0;
  }
}


/* NAV */
.help-nav{
  min-height:0;
  height: fit-content;
  background:var(--surface);
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: var(--shadow);
  border-radius: 7px;
 	margin: 0.6em 0.6em 0 0;
	border: 1px solid var(--border);
  max-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}

.nav-head{ 
  padding:12px 14px; 
  border-bottom:1px solid var(--border); 
  background:var(--surface-2); 
  font-weight:800; 
  
  position: sticky;
  top: 0;
  z-index: 2;
}

.help-nav-scroll {
  overflow: auto;
}

.nav-l1, .nav-l2, .nav-l3{ list-style:none; margin:0; padding:0; }

.nav-l1-item{ 
  padding: 0 10px;
  margin: 4px 0;
}

.nav-btn{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:0;
  background:transparent;
  border-radius:7px;
  cursor:pointer;
  text-align:left;
  color:var(--text);
  font:inherit;
}
.nav-btn:hover{ background:var(--surface-2); }

.nav-text{ display:block; }

.nav-arrow{
  margin-left:auto;
  display:inline-block;
  transition: transform .15s ease;
  color:var(--muted);
}

/* Arrow rotation when expanded */
.nav-btn[aria-expanded="true"] .nav-arrow{ transform: rotate(90deg); }
.nav-l2{ margin-top:4px; padding-left:10px; }
.nav-l2-item{ margin:4px 0 4px 10px; }
.nav-l3{ margin:4px 0 4px 18px; padding-left:10px; border-left:2px solid var(--border); }
.nav-l3-item{ margin:4px 0; }

/* Active marker (gäller även L1) */
.nav-btn.active-anchor{
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

/* CONTENT */
.content{
  min-height:0;
  overflow:auto;
  padding:18px 18px 60px;
  background:var(--surface);
}
.content-title{ margin:0 0 12px; font-size:1.35rem; }

img {
  max-width: 100%;
}
img.shadow {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
img.block {
  max-width: calc(100% - clamp(0.1rem, 3%, 2rem));
  display: block;
  height: auto;
  margin: 0.8rem 0 0.8rem clamp(0.1rem, 3%, 2rem);
}
@media (max-width: 660px){
  img.block {
    margin-left: 0;
    max-width: 100%;
  }
}

.callout{ background:var(--surface-2); border:1px dashed var(--border); border-radius:7px; padding:12px; color:var(--muted); margin:10px 0; }

.anchor{ scroll-margin-top: 12px; }

.content h2{ margin: 0 0 0.4em; font-size:1.9rem; }
.content h3{ margin:1.5em 0 0.4em; font-size:1.5rem; }
.content h4{ margin:1.2em 0 0.4em; font-size:1.25rem; }
.content a{ color:var(--link); }
.content a:hover{ color:var(--link-hover); }
code{ background:#f1f3f6; padding:2px 6px; border-radius:6px; }

.ui-text {
  font-style: italic;
}


@media (max-width: 960px){
  .layout{
    grid-template-columns: 1fr;
    height:auto;
    width:auto;
  }
}


@media (max-width: 960px) {
  body {
    overflow: hidden;
  }

  .layout {
    height: 100vh;
  }

  .content {
    height: calc(100vh - var(--top-ui-height));
    overflow-y: auto;
  }
}



/* =========================
   MOBILNAV
   ========================= */

.mobile-nav {
  display: none;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.mobile-nav .row {
  display: grid;
  gap: 10px;
}

.mobile-nav label {
  font-size: 0.9rem;
  color: var(--mobile-nav-label);
}

.mobile-nav select {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
}

/* Mobil: byt UI */
@media (max-width: 960px) {
  .help-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .layout {
    grid-template-columns: 1fr;
    width: auto;
  }
}


@media (max-width: 960px){
  body{
    overflow: auto;
  }
}

@media (max-width: 960px){
  .mobile-nav{
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

/* =========================================
   HELP CONTENT - semantic styling
   ========================================= */

#helpMain p{
  margin: 0.4em 0 0.8em;
}

#helpMain .plistp p {
  margin: 0.4em 0;
}

#helpMain .plistp p:has(+ ul),
#helpMain .plistp p:has(+ .search-example) {
  margin-bottom: 0.4em;
}

#helpMain .plistp ul + p {
  margin-top: 0.2em;
}

#helpMain .plistp ul {
  margin-bottom: 0.8em;
}


#helpMain .op {
  font-weight: 600;
  letter-spacing: 0.02em;
}

#helpMain .search-example {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f3f6;
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

#helpMain .example-line {
  margin-left: 2.5rem;
}

#helpMain .indent {
  margin-left: 2.5rem;
}

#helpMain .boolean-block {
  margin: 1rem 0;
}

#helpMain .boolean-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  column-gap: 1rem;
  margin: 0.6rem 0;
}

#helpMain .boolean-term {
  text-align: left;
}

#helpMain .boolean-def p {
  margin: 0.15em 0;
}

#helpMain ul {
  margin-left: 0.7rem;
}
#helpMain div > ul,
#helpMain div > ol {
  margin-top: 0.4rem
}
#helpMain li {
  margin: 0.2em 0;
}

#helpMain .ui-text {
  font-style: italic;
}

.search-example,
.meaning-example {
  width: fit-content;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  margin: 0.8em 0 0.8em 2rem;
}

.search-example {
  background: #f3f6f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.meaning-example {
  border: 1px solid #e0e0e0;
  background: transparent;
}

.logic-or {
  margin: 0.25rem 0;
}


.list-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.list-row-left {
  width: 80px;       /* styr indraget - ändra vid behov */
  font-weight: bold;
  padding-top: 0;
}

.list-row-right {
  flex: 1;
}

#helpMain p.list-row-desc {
  margin: 0 0 0.3rem 0;
}

.search-example {
  background: #f7f7f7;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  display: inline-block;
}

#helpMain .logic-list .search-example {
  margin-left: 0;
}

#helpMain .logic-list .list-row-right .meaning-example {
  margin-left: 0;
}

#helpMain .i-symbol {
  vertical-align: middle;
  position: relative;
  top: -1.5px;
}

.anchor {
  position: relative;
}

.anchor.content-highlight::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 3px;
  width: 100%;
  background: #f4c56c;
  border-radius: 2px;
  animation: fadeMarker 1s ease-out forwards;
}


@keyframes fadeMarker {
  0% { opacity: 1; }
  100% { opacity: 0; }
}


h2, h3, h4 {
  width: fit-content;
}

.nav-head {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-2);
	position: sticky;
	top: 0;
	z-index: 2;
	font-family: Georgia, serif;
	font-size: 1.7rem;
  color: #22458A;
	font-weight: 400;
}
body {
  font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
}

@media (max-width: 960px){
  .header-inner h1 {
    display: unset;             /* nu syns H1 */
  }
  /* Med justify-content: space-between får du H1 till vänster och English till höger */
}



.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.faq {
  padding-left: 1.5rem
}

#helpMain .faq li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.ip-copy-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    background: #EEE;
    border: 1px solid #DDD;
    margin: 0.3rem 0.5rem;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease,
                transform 0.1s ease;
}

.ip-copy-button:hover {
    background: #DDD;
    border-color: #CCC;
}

.ip-copy-button:active {
    transform: translateY(1px);
}

.ip-copy-button:focus-visible {
    outline: 2px solid #006298;
    outline-offset: 2px;
}

#copy-message {
  color:#006400;
  margin-left: 0.5em;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.nav-separator {
  list-style: none;
  margin: 1rem 0;
  border-top: 1px solid var(--border);
}