:root {
  --mentio-ink: #15182c;
  --mentio-muted: #65697d;
  --mentio-line: #e4e6ef;
  --mentio-surface: #fff;
  --mentio-soft: #f4f5f9;
  --mentio-brand: #5b5bf6;
  --mentio-brand-dark: #4141d6;
  --mentio-danger: #c93643;
  --mentio-radius-sm: 10px;
  --mentio-radius-md: 14px;
  --mentio-radius-lg: 20px;
  --mentio-shadow-menu: 0 18px 60px rgb(21 24 44 / 16%);
  --mentio-font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Page frame shared by all tools: usable width, side gutter (also the header's), space above and below. */
  --mentio-content-width: 1200px;
  --mentio-wide-width: 1440px;
  --mentio-gutter: 24px;
  --mentio-page-top: 40px;
  --mentio-page-bottom: 64px;
}
@media (max-width: 900px) { :root { --mentio-gutter: 16px; } }
@media (max-width: 640px) { :root { --mentio-page-top: 24px; --mentio-page-bottom: 48px; } }

/* Content area below the header. Standard for pages to read and choose; .mentio-page-wide for working views with
   side columns (e.g. running a survey). Only a view that needs every pixel (the survey editor) goes full width. */
.mentio-page {
  width: min(var(--mentio-content-width), 100% - 2 * var(--mentio-gutter));
  margin-inline: auto;
  padding-block: var(--mentio-page-top) var(--mentio-page-bottom);
}
.mentio-page.mentio-page-wide { width: min(var(--mentio-wide-width), 100% - 2 * var(--mentio-gutter)); }

.mentio-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px var(--mentio-gutter);
  border-bottom: 1px solid rgb(228 230 239 / 88%);
  background: rgb(255 255 255 / 94%);
  color: var(--mentio-ink);
  font-family: var(--mentio-font);
  box-shadow: 0 1px 0 rgb(21 24 44 / 2%);
}

@supports (backdrop-filter: blur(16px)) {
  .mentio-header { background: rgb(255 255 255 / 86%); backdrop-filter: blur(16px); }
}

/* Tool logo: coloured square plus the tool name in lower case – the same in every tool. */
mentio-product-brand { display: flex; align-items: center; min-width: 0; }
.mentio-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; padding-right: 6px; border-radius: var(--mentio-radius-sm); color: var(--mentio-ink); text-decoration: none; }
.mentio-brand-logo { flex: none; width: 34px; height: 34px; }
/* Optically centred: lower-case names without ascenders (gruppen) look low when the line box is centred, so they move up a little. */
.mentio-brand-name { overflow: hidden; font-size: 21px; font-weight: 800; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; transform: translateY(-.1em); }
.mentio-brand:focus-visible, .mentio-nav a:focus-visible,
.mentio-menu-trigger:focus-visible, .mentio-menu-item:focus-visible, .mentio-menu-home:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mentio-brand) 55%, transparent);
  outline-offset: 2px;
}

.mentio-header-center { justify-self: center; min-width: 0; }
.mentio-header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; }
mentio-app-menu { position: relative; display: block; flex: none; color: var(--mentio-ink); font-family: var(--mentio-font); }
/* Menu button: the icon only, as a round quiet button – no label, no caret, no border. */
.mentio-menu-trigger {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mentio-ink);
  cursor: pointer;
  transition: background 150ms ease;
}
.mentio-menu-trigger:hover, .mentio-menu-trigger[aria-expanded="true"] { background: rgb(29 29 43 / 6%); }
.mentio-menu-trigger svg { width: 24px; height: 24px; }
.mentio-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  width: min(280px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 96px));
  overflow: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--mentio-surface);
  box-shadow: var(--mentio-shadow-menu);
  transform-origin: top right;
  animation: mentio-menu-in 170ms cubic-bezier(.23, 1, .32, 1);
}
.mentio-menu-panel[hidden] { display: none !important; }
@keyframes mentio-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.mentio-menu-home { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 4px; padding: 6px 12px 10px; border-bottom: 1px solid var(--mentio-line); border-radius: 10px 10px 0 0; }
.mentio-menu-home img:first-child { width: 28px; height: auto; }
.mentio-menu-home img:last-child { width: 80px; height: auto; }
.mentio-menu-list { display: grid; gap: 2px; }
/* Large, single-line entries: logo or icon and the name. */
.mentio-menu-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mentio-ink);
  font: 600 16px/1.2 var(--mentio-font);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.mentio-menu-item:hover, .mentio-menu-item:focus-visible { background: var(--mentio-soft); }
/* The current tool: the names act as logos and stay alike; only the grey surface and the dark dot mark it. */
.mentio-menu-item[aria-current="page"] { background: var(--mentio-soft); }
.mentio-menu-logo { flex: none; width: 28px; height: 28px; }
.mentio-menu-item-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--mentio-muted); }
.mentio-menu-item-icon svg { width: 20px; height: 20px; }
/* Enough line height that descenders (g, p) are not clipped by the ellipsis overflow. */
.mentio-menu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.mentio-current-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--mentio-ink); }
.mentio-menu-divider { height: 1px; margin: 4px 6px; background: var(--mentio-line); }
.mentio-menu-item.danger, .mentio-menu-item.danger .mentio-menu-item-icon { color: var(--mentio-danger); }

/* Tool navigation in the middle of the header: grey strip, compact tabs with small radius. */
.mentio-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 13px; background: #f1f2f7; }
.mentio-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 15px; border-radius: 10px; color: var(--mentio-muted); font: 650 14px/1 var(--mentio-font); text-decoration: none; white-space: nowrap; transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.mentio-nav a:hover { color: var(--mentio-ink); }
.mentio-nav a[aria-current="page"] { background: var(--mentio-surface); color: var(--mentio-ink); box-shadow: 0 1px 5px rgb(21 24 44 / 10%); }
.mentio-nav a svg { width: 18px; height: 18px; }

/* Narrow screens: one row of the same height; the tool navigation shows its icons only (names stay readable for screen readers and as tooltips). */
.mentio-nav-label { white-space: nowrap; }
@media (max-width: 900px) {
  .mentio-header { display: flex; justify-content: space-between; gap: 8px; }
  .mentio-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mentio-nav a { gap: 4px; min-width: 44px; padding-inline: 10px; }
}

@media (max-width: 640px) {
  .mentio-header { padding-block: 8px; }
  .mentio-brand-name { display: none; }
  .mentio-brand-logo { width: 32px; height: 32px; }
  .mentio-brand-name { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .mentio-menu-panel { animation: none; }
  .mentio-menu-trigger, .mentio-nav a { transition: none; }
}
