/* Carbon-aligned shell (glyph navigation) — companion to app/assets/tailwind/application.css */

.glyph-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #e0e0e0;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(12px);
}

.glyph-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.glyph-brand__logo {
  width: 2.5rem !important;
  height: 2.5rem !important;
  max-width: 2.5rem !important;
  max-height: 2.5rem !important;
  object-fit: contain;
  flex-shrink: 0;
}

.glyph-brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.02rem;
}

.glyph-brand__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #161616;
}

.glyph-brand__meta {
  font-family: "IBM Plex Mono", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.64rem;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #525252;
}

.glyph-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 0.25rem;
  border: 1px solid #e0e0e0;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 1px 0 rgb(22 22 22 / 0.03);
}

.glyph-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid transparent;
  font-family: "IBM Plex Mono", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #525252;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.glyph-nav-link:hover {
  border-color: #e0e0e0;
  background: #f4f4f4;
  color: #161616;
}

.glyph-nav-link[data-active="true"] {
  border-color: #161616;
  background: #161616;
  color: #ffffff;
}

.glyph-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  border: 1px solid #c6c6c6;
  padding: 0.7rem 1rem;
  font-family: "IBM Plex Mono", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  cursor: pointer;
}

.glyph-button:hover {
  transform: translateY(-1px);
}

.glyph-button:focus {
  outline: 2px solid #0f62fe;
  outline-offset: 2px;
}

.glyph-button--primary {
  border-color: #161616;
  background: #161616;
  color: #ffffff;
}

.glyph-button--primary:hover {
  border-color: #393939;
  background: #393939;
}

.glyph-button--secondary {
  border-color: #8d8d8d;
  background: #ffffff;
  color: #161616;
}

.glyph-button--secondary:hover {
  border-color: #161616;
  background: #f4f4f4;
}

.glyph-button--ghost {
  border-color: transparent;
  background: transparent;
  color: #0f62fe;
}

.glyph-button--ghost:hover {
  border-color: #e0e0e0;
  background: #f4f4f4;
  color: #0043ce;
}

/* —— Carbon-inspired form primitives (aligned to carbon design system spacing / color tokens) —— */

.cds-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cds-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: #525252;
  letter-spacing: 0.02em;
}

.cds-text-input__field,
.cds-text-area__field {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid #8d8d8d;
  background: #f4f4f4;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #161616;
  padding: 0.65rem 0.75rem;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.cds-text-input__field:focus,
.cds-text-area__field:focus {
  outline: 2px solid #0f62fe;
  outline-offset: -2px;
  background: #ffffff;
}

.cds-text-area__field {
  min-height: 5rem;
  resize: vertical;
}

.cds-number {
  display: flex;
  align-items: stretch;
  border: 1px solid #8d8d8d;
  background: #ffffff;
}

.cds-number__btn {
  width: 2.5rem;
  border: none;
  background: #f4f4f4;
  font-size: 1.1rem;
  color: #161616;
  cursor: not-allowed;
}

.cds-number__field {
  flex: 1;
  border: none;
  text-align: center;
  font-size: 0.875rem;
  padding: 0.5rem;
}

.cds-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.cds-radio,
.cds-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #161616;
}

.cds-radio__input,
.cds-checkbox__input {
  margin-top: 0.2rem;
  accent-color: #0f62fe;
}

.cds-radio__label,
.cds-checkbox__label {
  line-height: 1.45;
}

.cds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid #8d8d8d;
  border-radius: 0;
  background: #ffffff;
  color: #161616;
}

.cds-btn--secondary {
  background: #f4f4f4;
}

/* Rating / NPS chip radios */
.cds-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cds-chip__input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.cds-chip__text {
  display: inline-flex;
  min-width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.45rem;
  border: 1px solid #c6c6c6;
  background: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #161616;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.cds-chip--dense .cds-chip__text {
  min-width: 1.75rem;
  height: 2rem;
  font-size: 0.6875rem;
}

.cds-chip__input:focus + .cds-chip__text {
  outline: 2px solid #0f62fe;
  outline-offset: 1px;
}

.cds-chip__input:checked + .cds-chip__text {
  border-color: #0f62fe;
  background: #edf5ff;
  color: #0043ce;
}

/* Progress indicator (horizontal) */
.cds-progress__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.cds-progress__step {
  flex: 1;
  text-align: center;
  position: relative;
}

.cds-progress__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.9rem;
  left: 50%;
  width: 100%;
  height: 1px;
  background: #c6c6c6;
  z-index: 0;
}

.cds-progress__indicator-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.cds-progress__indicator {
  display: flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #c6c6c6;
  background: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  color: #525252;
}

.cds-progress__step--current .cds-progress__indicator {
  border-color: #0f62fe;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #0f62fe;
  color: #0f62fe;
}

.cds-progress__step--complete .cds-progress__indicator--complete {
  border-color: #198038;
  background: #198038;
  color: #ffffff;
  font-size: 0.6rem;
}

.cds-progress__label {
  display: block;
  margin-top: 0.35rem;
  font-family: "IBM Plex Mono", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f6f6f;
}

.cds-progress__step--current .cds-progress__label {
  color: #161616;
}

/* Question card system (shared Glyph spacing cadence) */
.glyph-question-card {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #ffffff;
  padding: 1rem 1.125rem;
}

.glyph-question-card--preview {
  padding: 0.75rem 0.875rem;
}

.glyph-question-card--compact {
  background: #f4f4f4;
}

.glyph-question-card--callout {
  border-color: #a6c8ff;
  border-left: 4px solid #0f62fe;
  background: #edf5ff;
}

.glyph-question-card--panel {
  padding: 0;
  overflow: hidden;
}

.glyph-question-card__panel-head {
  background: #262626;
  padding: 0.55rem 0.95rem;
  font-family: "IBM Plex Mono", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
}

.glyph-question-card__panel-body {
  background: #ffffff;
  padding: 0.95rem 1rem 1rem;
}

.glyph-question-card__body-wrap--rule {
  padding-bottom: 0.65rem;
  border-bottom: 2px solid #0f62fe;
}

.glyph-question-card__eyebrow,
.glyph-question-card__meta {
  margin: 0;
  font-family: "IBM Plex Mono", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.62rem;
  line-height: 1.35;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #525252;
}

.glyph-question-card__eyebrow {
  margin-bottom: 0.25rem;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.glyph-question-card__body {
  margin: 0;
  color: #161616;
}

.glyph-question-card__body--quiz_list {
  font-size: 0.875rem;
  line-height: 1.6;
  font-weight: 500;
}

.glyph-question-card__body--picker_preview {
  font-size: 0.875rem;
  line-height: 1.6;
}

.glyph-question-card__body--preview_step {
  font-size: 1.375rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.glyph-question-card__body--emphasized.glyph-question-card__body--quiz_list,
.glyph-question-card__body--emphasized.glyph-question-card__body--picker_preview {
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 600;
}

.glyph-question-card__body--emphasized.glyph-question-card__body--preview_step {
  font-size: 1.7rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.glyph-question-card__body--compact.glyph-question-card__body--preview_step {
  font-size: 1.125rem;
}

.glyph-question-card__meta {
  margin-top: 0.55rem;
}

.glyph-question-card__meta--muted {
  color: #6f6f6f;
}

.glyph-question-card__meta--blue {
  color: #0043ce;
}

/* Shared row spacing for index/show list containers */
.glyph-list-row {
  display: block;
}

.glyph-list-row__inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}

.glyph-list-row__inner--start {
  gap: 1rem;
}

@media (min-width: 640px) {
  .glyph-list-row__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .glyph-list-row__inner--start {
    align-items: flex-start;
  }
}

@media (min-width: 640px) {
  .glyph-question-card__body--preview_step {
    font-size: 1.55rem;
  }

  .glyph-question-card__body--emphasized.glyph-question-card__body--preview_step {
    font-size: 1.95rem;
  }
}

@media (max-width: 1023px) {
  .glyph-nav {
    width: 100%;
    justify-content: center;
  }
}

/* Add-question modal (quiz builder) */
.pq-add-question-dialog {
  width: min(52rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgb(22 22 22 / 0.18);
  background: #ffffff;
}

.pq-add-question-dialog::backdrop {
  background: rgb(22 22 22 / 0.45);
}

.pq-add-question-dialog__inner {
  display: flex;
  max-height: calc(100vh - 2rem);
  flex-direction: column;
}

.pq-add-question-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.pq-add-question-dialog__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #161616;
}

.pq-add-question-dialog__close {
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #525252;
  cursor: pointer;
  border-radius: 2px;
}

.pq-add-question-dialog__close:hover {
  background: #e0e0e0;
  color: #161616;
}

.pq-add-question-dialog__panel {
  overflow: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.pq-add-question-dialog__lead {
  margin: 0 0 1rem;
  max-width: 42rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #525252;
}

.pq-catalog-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
}

.pq-catalog-tile {
  padding: 0;
  overflow: hidden;
}

.pq-catalog-tile__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.75rem;
}

.pq-catalog-tile__label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #161616;
}

.pq-catalog-tile__desc {
  margin: 0;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #525252;
}

.pq-catalog-tile__preview {
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  background: #ffffff;
  padding: 0.35rem 0.45rem;
  transform: scale(0.92);
  transform-origin: top left;
  max-height: 7.5rem;
  overflow: hidden;
}

.pq-style-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}

.pq-style-option {
  display: flex;
  width: 100%;
  cursor: pointer;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 2px solid #e0e0e0;
  background: #ffffff;
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.pq-style-option__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #161616;
}

.pq-style-option__desc {
  font-size: 0.65rem;
  line-height: 1.35;
  color: #525252;
}

.pq-style-option__preview {
  margin-top: 0.25rem;
  pointer-events: none;
}

.pq-style-option:hover {
  border-color: #8d8d8d;
}

.pq-style-option--active {
  border-color: #0f62fe;
  box-shadow: 0 0 0 1px #0f62fe;
}

.pq-add-question-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}
