.global-bar{box-sizing:border-box;display:flex;align-items:center;gap:clamp(20px,4vw,62px);position:sticky;top:0;z-index:8;background:var(--shell,#fff);color:var(--fg,#192334);border-bottom:1px solid var(--line,#dce3e6);padding:0 clamp(12px,2.5vw,40px);min-height:68px;font:600 15px/1.6 var(--ui-font)}
.global-brand,.global-tabs a,.global-bar>button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;text-decoration:none}
.global-brand{flex:none}.global-brand img.dinar-wordmark{display:block;width:108px;height:auto;color-scheme:inherit}.global-tabs{align-self:stretch;display:flex;align-items:stretch;gap:clamp(8px,2vw,30px)}
.global-tabs a{position:relative;padding:0 5px;color:inherit;white-space:nowrap}.global-tabs a:hover{color:var(--green,var(--accent,#087f56))}
.global-tabs a[aria-current=page]{color:var(--green,var(--accent,#087f56));font-weight:750}.global-tabs a[aria-current=page]::after{content:'';position:absolute;inset-inline:4px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:currentColor}
.global-bar>button{margin-inline-start:auto;width:44px;flex:none;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;font-size:21px}.global-bar>button:hover{background:var(--chip,var(--surface,#eff4f3))}.global-bar>button svg{width:20px;height:20px}
.global-bar :focus-visible,.section-tools :focus-visible{outline:2px solid currentColor;outline-offset:-3px}
.global-bar+.section-tools{display:flex;align-items:center;flex-wrap:wrap;gap:16px;padding:8px 16px;font-size:14px}.section-tools form{margin:0}
.window:has(>.global-bar){display:flex;flex-direction:column}.window>#contentStart{height:0}.window>section:not([hidden]){flex:1}.window>footer{margin-top:auto}
.global-bar a,.console-page .global-tabs a{text-decoration:none}.console-page .global-tabs a[aria-current=page]{color:var(--green)}
html{scroll-padding-top:82px}
@media(max-width:720px){
.global-bar{display:grid;grid-template-columns:1fr auto;gap:0;padding:0 8px;min-height:0}.global-brand{justify-self:start}.global-brand img.dinar-wordmark{width:84px}.global-bar>button{grid-column:2;grid-row:1}.global-tabs{grid-column:1/-1;grid-row:2;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0}.global-tabs a{font-size:13px;padding:0 2px}.global-tabs a[aria-current=page]::after{inset-inline:10%}html{scroll-padding-top:100px}
}

/* Give the banknote collage room at the corners of the app. */
html {
  --outer-paper: #101827;
  --frame-tint: rgb(16 24 39 / 6%);
  --collage-offset: clamp(-76px, -4.5vw, -18px);
  --frame-top: clamp(94px, 12.2vw, 175px);
  --frame-gutter: clamp(18px, 4vw, 72px);
  --frame-bottom: clamp(48px, 6.8vw, 104px);
}

html[data-theme=light] {
  --outer-paper: #e5eaf1;
  --frame-tint: rgb(229 234 241 / 62%);
}

body, body.console-page {
  isolation: isolate;
  background-color: var(--outer-paper);
  background-image:
    linear-gradient(var(--frame-tint) 15%, var(--outer-paper) min(49vw, 850px)),
    url('/libyan-dinar-collage.webp');
  background-size: 100% max(100vh, 49vw), 100% auto;
  background-position: center top, center var(--collage-offset);
  background-repeat: no-repeat;
  background-attachment: fixed;
}


/* Blend a second collage into the lower half so the currency follows the whole frame. */
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: '';
  pointer-events: none;
  background: linear-gradient(var(--frame-tint), var(--frame-tint)), url('/libyan-dinar-edges.webp') center bottom / 100% 100% no-repeat;
  mask-image: linear-gradient(transparent 28%, #000 67%);
}

.window:has(>.global-bar), .console-window:has(>.global-bar) {
  width: min(1660px, calc(100% - 2 * var(--frame-gutter)));
  margin: var(--frame-top) auto var(--frame-bottom);
  min-height: calc(100svh - var(--frame-top) - var(--frame-bottom));
  border-radius: 17px;
}

body:has(>.workspace) {
  padding: var(--frame-top) var(--frame-gutter) var(--frame-bottom);
}

.workspace:has(>.global-bar) {
  min-height: calc(100svh - var(--frame-top) - var(--frame-bottom));
  border-radius: 17px;
}

@media (max-width: 720px) {
  html {
    --frame-top: clamp(83px, 23vw, 112px);
    --collage-offset: -10px;
    --frame-gutter: 12px;
    --frame-bottom: 48px;
  }
  body, body.console-page { background-attachment: scroll; }
  body::before {
    inset-block-start: 36vh;
    background-size: auto, 100% 100%;
  }
  .window:has(>.global-bar), .console-window:has(>.global-bar), .workspace:has(>.global-bar) {
    border-radius: 12px;
  }
}

@media (max-width: 800px) {
  /* Scalar's mobile layout uses the full viewport width. */
  .reference .console-window:has(>.global-bar) { width: 100%; }
}

/* Currency codes sit on the artwork above the dashboard. */
.currency-ribbon {
  display: flex;
  align-items: center;
  width: min(1660px, calc(100% - 2 * var(--frame-gutter)));
  height: 38px;
  margin: var(--frame-top) auto 0;
  overflow-x: auto;
  border: 1px solid rgb(163 183 214 / 24%);
  border-radius: 8px;
  background: rgb(13 22 38 / 94%);
  color: #a9bad2;
  font: 600 11px/1 system-ui, sans-serif;
  letter-spacing: .09em;
  scrollbar-width: thin;
  scrollbar-color: #4c6282 transparent;
}

[data-theme=light] .currency-ribbon {
  background: rgb(233 239 248 / 96%);
  color: #435670;
}

.currency-ribbon span {
  flex: none;
  padding: 0 14px;
}

.currency-ribbon span:first-child {
  position: sticky;
  left: 0;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-inline-end: 1px solid #6a5938;
  background: #252438;
  color: #f1cf8c;
}

.currency-ribbon:not([hidden]) + .window {
  margin-top: 10px;
  min-height: calc(100svh - var(--frame-top) - var(--frame-bottom) - 48px);
}

/* The currency artwork frames a dedicated rail for the bank directory. */
body::after {
  --bank-strip-tile: 2520px;
  position: fixed;
  z-index: -1;
  top: calc(var(--frame-top) - 56px);
  left: 50%;
  transform: translateX(-50%);
  width: min(1660px, calc(100% - 2 * var(--frame-gutter)));
  height: 46px;
  box-sizing: border-box;
  content: '';
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bank-sprite) 0 center / var(--bank-strip-tile) auto repeat-x, var(--bank-rail);
  animation: bank-strip-scroll 108s linear infinite;
}

@keyframes bank-strip-scroll {
  to { background-position-x: calc(-1 * var(--bank-strip-tile)), 0; }
}

#bankDirectoryButton {
  position: absolute;
  top: calc(var(--frame-top) - 55px);
  inset-inline-end: max(calc(var(--frame-gutter) + 1px), calc((100% - 1658px) / 2));
  z-index: 2;
  height: 44px;
  padding-inline: 14px;
  border-inline-start: 1px solid var(--ui-control-line);
  border-radius: 0 7px 7px 0;
  background: var(--bank-button);
  color: var(--bank-button-ink);
  font: 650 14px/1.4 var(--ui-font);
}
#bankDirectoryButton:hover, #bankDirectoryButton:focus-visible { background: var(--bank-button-hover); }
html:has(#bankDirectory[open]) body::after { animation-play-state: paused; }

#bankDirectory {
  width: min(670px, calc(100% - 24px));
  max-height: 83svh;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--shell);
  color: var(--fg);
  font-family: var(--ui-font);
}
#bankDirectory::backdrop { background: rgb(3 7 15 / 76%); }
.bank-directory-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-block-end: 1px solid var(--line);
  background: var(--shell);
}
.bank-directory-header h2 { margin: 0; font-size: 20px; }
.bank-directory-header button {
  min-height: 36px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
#bankDirectory p { margin: 12px 18px; color: var(--dim); font-size: 13px; }
#bankDirectory p a { text-decoration: underline; }
#bankDirectory ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(134px, 1fr));
  gap: 1px;
  padding: 1px;
  margin: 14px 18px 18px;
  background: var(--line);
  list-style: none;
}
#bankDirectory li {
  display: grid;
  min-height: 104px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 10px;
  background: var(--shell);
  text-align: center;
  font-size: 13px;
}
#bankDirectory img {
  width: 65px;
  height: 34px;
  object-fit: contain;
}


@media (max-width: 720px) {
  body::after {
    --bank-strip-tile: 1950px;
    height: 40px;
    top: calc(var(--frame-top) - 50px);
  }
  #bankDirectoryButton {
    top: calc(var(--frame-top) - 49px);
    height: 38px;
    padding-inline: 9px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

.global-tabs .nav-screen-short { display: none; }
@media (max-width: 720px) {
  .global-tabs .nav-screen-full { display: none; }
  .global-tabs .nav-screen-short { display: inline; }
}
