/* The merchant desk's own frame: a sidebar on the night ground beside one white sheet. */
:root {
  --ground: #042224;
  --ground-lit: #0a3f42;
  --surface: #ffffff;
  --ink: #14222d;
  --ink-2: #56656f;
  --ink-3: #33434c;
  --steel-2: #637178;
  --quiet: #8a979d;
  --faint: #a3aeb3;
  --hair: #e3e9ec;
  --edge: #cdd6da;
  --rail: #d9e1e4;
  --mist: #f7f9fa;
  --chip: #f2f5f6;
  --brand: #216f73;
  --brand-600: #1b5d60;
  --brand-700: #07585c;
  --brand-800: #004245;
  --brand-300: #bfdadc;
  --brand-100: #eff7f7;
  --hero-from: #0d6a6e;
  --hero-to: #00363a;
  --coal: #0f1d20;
  --mint: #9fe0c3;
  --parcel-lid: #ffd08a;
  --tile-top: #0f6a6f;
  --tile-bottom: #08575b;
  --success: #087043;
  --success-100: #eef8f1;
  --danger: #c8151b;
  --danger-700: #94000b;
  --danger-100: #fff2f0;
  --on-night-2: rgba(255, 255, 255, 0.72);
  --on-night-3: rgba(255, 255, 255, 0.46);
  --night-hair: rgba(255, 255, 255, 0.09);
  --on-ground-2: rgba(255, 255, 255, 0.8);
  --on-ground-3: rgba(255, 255, 255, 0.6);
  --write-on-ground: #9fd6d8;
  --delete-on-ground: #ff968a;

  --sans: "Tajawal", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --display: "Alexandria", "Tajawal", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --lat: "DM Sans", "Tajawal", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --side: 248px;
  --bar: 54px;
  --code-col: 470px;
  --gutter: 44px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: radial-gradient(70% 55% at 0% 0%, var(--ground-lit) 0%, var(--ground) 70%) fixed;
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
ol,
ul {
  list-style: none;
}
a {
  color: var(--brand-700);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* A hidden element stays hidden whatever display its class gives it. */
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
code,
pre,
.mono {
  font-family: var(--mono);
}
.lat {
  font-family: var(--lat);
  font-variant-numeric: tabular-nums;
}
.i {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 30;
  padding: 8px 14px;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.skip:focus {
  top: calc(env(safe-area-inset-top, 0px) + 8px);
}
p code,
dd code,
td code,
.answers code,
.points code {
  font-size: 0.84em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--mist);
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--ink);
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* The desk */
.desk {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  height: 100%;
}
.desk.is-wide {
  grid-template-columns: minmax(0, 1fr);
}
.desk.is-wide .side {
  display: none;
}
.desk.is-wide .sheet {
  margin-inline-start: 8px;
}

/* Sidebar */
.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  overflow-y: auto;
  padding: 14px 10px 12px;
}
.side > * {
  flex-shrink: 0;
}
.side :focus-visible {
  outline-color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 4px;
  text-decoration: none;
}
.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: linear-gradient(to bottom, var(--tile-top), var(--tile-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.mark-32 {
  width: 32px;
  height: 32px;
  border-radius: 7.2px;
}
.mark-28 {
  width: 28px;
  height: 28px;
  border-radius: 6.3px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand-sub {
  font-size: 12px;
  line-height: 1;
  color: var(--on-ground-3);
}
.word {
  display: block;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--on-ground-3);
}
.search:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--mint);
}
.search .i {
  width: 15px;
  height: 15px;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font: 500 14px var(--sans);
  color: #fff;
}
.search input::placeholder {
  color: var(--on-ground-3);
}
.search input::-webkit-search-cancel-button {
  display: none;
}
.search kbd {
  padding: 0 6px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font: 500 11px/1.7 var(--mono);
  color: var(--on-ground-3);
}
.side.is-searching nav {
  display: none;
}
.no-result {
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--on-ground-3);
}

/* The bar carries this action on a wide screen; the sidebar takes it over on a narrow one. */
.side-cta {
  display: none;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 160ms ease-out,
    transform 160ms ease-out;
}
.side-cta .i {
  color: var(--brand-700);
}
.side-cta:hover {
  background: var(--chip);
}
.side-cta:active {
  transform: scale(0.97);
}

.group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.group-label {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-ground-3);
}
#nav-reference .group-label {
  margin-top: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 9px;
  color: var(--on-ground-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}
.nav-item .i {
  color: var(--on-ground-3);
  stroke-width: 1.9;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-item[aria-current="true"] {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav-item[aria-current="true"] .i {
  color: var(--mint);
  stroke-width: 2.2;
}
.nav-item.result {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.nav-item.result small {
  font-size: 11.5px;
  color: var(--on-ground-3);
}
.nav-item.is-picked {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}
.side-foot {
  margin-top: auto;
  padding-top: 8px;
}
.side-foot .nav-item {
  color: var(--on-ground-3);
}

/* The method leads its entry, and its colour says what the call does: read, write, delete. */
.verb {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--quiet);
}
.nav-item .verb {
  order: -1;
  flex: none;
  width: 30px;
  font-size: 10px;
  color: var(--on-ground-3);
}
.nav-item .verb-get {
  color: var(--mint);
}
.nav-item .verb-post,
.nav-item .verb-put {
  color: var(--write-on-ground);
}
.nav-item .verb-delete {
  color: var(--delete-on-ground);
}

/* The sheet and its bar */
.sheet {
  margin: 8px 8px 8px 0;
  min-width: 0;
  height: calc(100% - 16px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  scroll-padding-top: calc(var(--bar) + 22px);
  scroll-behavior: smooth;
}
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--bar);
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--hair);
}
.bar-brand,
.bar .menu-button {
  display: none;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ink-2);
}
.icon-button:hover {
  background: var(--chip);
}
.bar-rule {
  width: 1px;
  height: 18px;
  background: var(--hair);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.crumbs .i {
  width: 14px;
  height: 14px;
  color: var(--faint);
}
.crumbs b {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-end {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.lang {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--chip);
}
.lang button {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--steel-2);
}
.lang button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 34, 45, 0.1);
}
.bar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.bar-link:hover {
  background: var(--chip);
  color: var(--ink);
}
.bar-link .i {
  width: 15px;
  height: 15px;
}
.bar-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin-inline-start: 6px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 4px 10px -6px rgba(0, 45, 47, 0.6);
  transition:
    background-color 160ms ease-out,
    transform 160ms ease-out;
}
.bar-cta:hover {
  background: var(--brand-600);
}
.bar-cta:active {
  transform: scale(0.97);
}
.bar-cta .i {
  width: 15px;
  height: 15px;
}

.body {
  padding: 28px 40px 64px;
}
.page {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
}

/* On a narrow screen the sheet is the page, and the sidebar opens over it from the bar. */
@media (max-width: 1099px) {
  html,
  body {
    height: auto;
  }
  html {
    scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--bar) + 22px);
  }
  .desk {
    display: block;
    height: auto;
  }
  .sheet {
    margin: 0;
    height: auto;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
  }
  .bar {
    top: env(safe-area-inset-top, 0px);
    padding: 0 16px;
    gap: 8px;
  }
  .bar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
  }
  .bar .menu-button {
    display: inline-flex;
  }
  .side-toggle,
  .bar-rule,
  .crumbs,
  .bar-link,
  .bar-cta {
    display: none;
  }
  .side {
    display: none;
    position: fixed;
    inset: calc(env(safe-area-inset-top, 0px) + var(--bar)) 0 0 0;
    z-index: 4;
    height: auto;
    background: var(--ground);
    padding: 14px 16px 24px;
  }
  .side .brand {
    display: none;
  }
  .side-cta {
    display: flex;
  }
  .desk.is-open .side {
    display: flex;
  }
  .body {
    padding: 20px 16px 48px;
  }
  .page {
    gap: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .sheet {
    scroll-behavior: auto;
  }
}
