/**
 * @file tokens.css
 * @brief Shared Novocore colors, typography, sticky Microsoft-365-style top bar, and footer chrome.
 */

:root {
  --nc-black: #000000;
  --nc-white: #ffffff;
  --nc-green: #009e60;
  --nc-slate: #37505b;
  --nc-steel: #607d8b;
  --nc-line: #2c3b43;
  --nc-footer: #10161a;
  --nc-bg: #0c1216;
  --nc-card: #172026;
  --nc-text: #f3f6f7;
  --nc-muted: #b7c5cb;
  --nc-font: "Segoe UI", Arial, Helvetica, sans-serif;
  --nc-header-height: 52px;
  color-scheme: dark;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--nc-bg);
  color: var(--nc-text);
  font-family: var(--nc-font);
}

.nc-header {
  flex: none;
  z-index: 900;
  height: var(--nc-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  padding: 0 16px;
  background: #0a1014;
  color: var(--nc-text);
  border-bottom: 1px solid var(--nc-line);
  font-family: var(--nc-font);
}

.nc-brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nc-launcher {
  position: relative;
}

.nc-waffle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--nc-text);
  cursor: pointer;
  font: inherit;
}

.nc-launcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 320px;
  box-sizing: border-box;
  padding: 10px;
  background: #182228;
  border: 1px solid var(--nc-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.nc-launcher-app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--nc-text);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.nc-launcher-app.is-beta {
  border-color: #e53935;
}

.nc-beta-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #e53935;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.nc-launcher-app:hover,
.nc-launcher-app:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.nc-launcher-app img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  background: #0c1216;
}

.nc-launcher-app span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nc-waffle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nc-waffle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.nc-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nc-logo {
  display: block;
  height: 32px;
  width: auto;
}

.nc-brand-divider {
  width: 1px;
  height: 20px;
  background: var(--nc-line);
}

.nc-product {
  margin: 0;
  color: var(--nc-text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-product-link {
  text-decoration: none;
}

.nc-product-link:hover {
  text-decoration: underline;
}

.nc-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nc-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Scope root of the active tool (`@scope ([data-tool="<id>"])`); generates no box of its own. */
.nc-tool {
  display: contents;
}

.nc-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-sizing: border-box;
  padding: 10px 16px;
  background: var(--nc-footer);
  color: var(--nc-muted);
  border-top: 1px solid var(--nc-line);
  font-size: 13px;
  line-height: 1.4;
}

.nc-footer p {
  margin: 0;
}

.nc-footer a {
  color: inherit;
}

.nc-footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nc-version {
  margin: 0;
  color: var(--nc-muted);
  opacity: 0.65;
  font-size: 12px;
}

.nc-button {
  display: inline-block;
  padding: 13px 20px;
  background: var(--nc-green);
  color: var(--nc-black);
  font-weight: 700;
  font-family: var(--nc-font);
  border: 0;
  text-decoration: none;
  cursor: pointer;
}

.nc-button:focus-visible,
.nc-header a:focus-visible,
.nc-footer a:focus-visible {
  outline: 2px solid var(--nc-green);
  outline-offset: 2px;
}

.nc-combobox {
  position: relative;
  min-width: 0;
}

.nc-combobox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nc-combobox-row input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.nc-clear-btn,
button.text-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #3d6b5c;
  border-radius: 4px;
  background: #16352d;
  color: #e7f6ee;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.nc-clear-btn:hover:not(:disabled),
button.text-button:hover:not(:disabled) {
  background: #1e4d3d;
  border-color: #5dca8a;
  color: #ffffff;
}

.nc-clear-btn:active:not(:disabled),
button.text-button:active:not(:disabled) {
  background: #3fa36a;
  border-color: #3fa36a;
  color: #062018;
}

.nc-clear-btn:disabled,
button.text-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nc-combobox.is-compact input {
  box-sizing: border-box;
  height: 24px;
  min-height: 0;
  padding: 0 6px;
  border: 1px solid var(--nc-line);
  border-radius: 0;
  background: var(--nc-bg);
  color: inherit;
  font-size: 12px;
}

.nc-combobox-list {
  position: fixed;
  z-index: 1200;
  max-height: 220px;
  margin: 0;
  padding: 2px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--nc-line);
  background: #121a1f;
  box-sizing: border-box;
}

.nc-combobox-list button {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nc-combobox-list button:hover,
.nc-combobox-list button:focus-visible {
  background: #1c2a31;
  color: #3fa36a;
}

.nc-combobox-list small,
.nc-combobox-empty,
.nc-combobox-note {
  color: var(--nc-muted);
  font-size: 12px;
}

.nc-combobox-empty,
.nc-combobox-note {
  margin: 0;
  padding: 4px 6px;
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .nc-header {
    padding: 0 10px;
    gap: 8px;
  }

  .nc-brand-left {
    gap: 8px;
  }

  .nc-brand-divider,
  .nc-product {
    display: none;
  }

  .nc-waffle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .nc-brand-link {
    min-height: 44px;
  }

  .nc-logo {
    height: 24px;
  }

  .nc-tools {
    gap: 6px;
  }

  .nc-lang-btn,
  .nc-header-btn,
  .nc-m365-signin-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .nc-avatar-btn {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
  }

  .nc-launcher-panel,
  .nc-account-popover {
    width: min(320px, calc(100vw - 24px));
  }

  .nc-body > main,
  .nc-body > .nc-tool > main {
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .nc-body input:not([type="checkbox"]):not([type="radio"]),
  .nc-body select,
  .nc-body .nc-combobox input,
  .nc-body .nc-combobox.is-compact input,
  .nc-body .nc-button,
  .nc-body .primary-button,
  .nc-body .secondary-button {
    min-height: 44px;
  }

  .nc-footer {
    padding: 12px 16px;
  }
}
