/* Gameficate Craft — Top bar: logo, title, language switch, status badge and buttons (labels fold away on narrow screens). */
/* ---------- top bar ---------- */
.top {
  height: 68px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  z-index: 1000;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffb057, var(--orange) 55%, var(--orange-d));
}
.logo .badge.brand svg {
  width: 100%;
  height: 100%;
}
.logo .word {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.logo .word span {
  color: #ffc83d;
}
.logo .word small {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  opacity: 0.75;
  margin-left: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.doc-title {
  font-weight: 800;
  font-size: 16px;
  opacity: 0.9;
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spacer {
  flex: 1;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.12);
}
.status {
  border: 0;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}
.status:hover,
.status:focus-visible {
  filter: brightness(1.12);
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}
.status.ok {
  background: rgba(30, 158, 98, 0.9);
}
.status.warn {
  background: rgba(201, 130, 5, 0.95);
}
.status.err {
  background: rgba(217, 60, 65, 0.95);
}
.tb {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tb:hover {
  background: rgba(255, 255, 255, 0.24);
}
.tb.primary {
  background: var(--orange);
  border-color: var(--orange);
}
.tb.primary:hover {
  filter: brightness(1.06);
}
/* ---------- The two language menus (js/ui/LanguageMenu.js): 🌐 Craft and ✏️ Writing in ---------- */
.langbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-menu {
  position: relative;
}
.lang-menu-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  max-width: 220px;
}
.lang-menu-btn:hover,
.lang-menu-btn[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.24);
}
.lang-menu-btn .lm-ic {
  font-size: 18px;
}
.lang-menu-btn .lm-txt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  min-width: 0;
}
.lang-menu-btn small {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.75;
}
.lang-menu-btn b {
  font-size: 14px;
  font-weight: 900;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-menu-btn .lm-caret {
  font-size: 11px;
  opacity: 0.8;
}
.lang-menu-list {
  position: absolute;
  z-index: 2000;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 260px;
  max-height: min(420px, 70vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 18px 40px rgba(10, 25, 40, 0.25);
}
.lm-item,
.lm-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: start;
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.lm-item:hover,
.lm-item:focus-visible,
.lm-foot:hover,
.lm-foot:focus-visible {
  background: var(--soft);
  outline: none;
}
.lm-item.on {
  background: #fff1e8;
}
.lm-check {
  width: 16px;
  flex: 0 0 auto;
  font-weight: 900;
  color: var(--orange-d);
}
.lm-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.lm-names b {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}
.lm-names span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.lm-tags {
  display: flex;
  gap: 6px;
  font-style: normal;
}
.lm-tags i {
  font-style: normal;
  font-weight: 900;
  color: var(--muted);
}
.lm-foot {
  margin-top: 4px;
  border-top: 2px solid var(--line);
  border-radius: 0 0 10px 10px;
  font-weight: 900;
  color: var(--orange-d);
}

.tb.icon {
  min-width: 40px;
  padding: 0 10px;
  font-size: 20px;
}
.tb:disabled {
  opacity: 0.4;
  cursor: default;
}
.top .tb,
.top .status,
.top .langbar {
  white-space: nowrap;
  flex: 0 0 auto;
}
.top .doc-title {
  min-width: 0;
  flex: 0 1 auto;
}
@media (max-width: 1560px) {
  .top {
    gap: 8px;
    padding: 0 12px;
  }
  .top .tb {
    padding: 0 10px;
    font-size: 14px;
  }
  .top .status {
    padding: 0 10px;
    font-size: 13px;
  }
  .logo .word small {
    display: none;
  }
}
@media (max-width: 1280px) {
  .top .doc-title,
  .lang-menu-btn small {
    display: none;
  }
  #historyBtn .lbl,
  #newBtn .lbl,
  #importBtn .lbl,
  #exportBtn .lbl {
    display: none;
  }
}
