/* Egon Zehnder brand tokens.
   Red #B61A37 verified against the official EZ logo SVG.
   Navy / gray / typography from the EDGE methodology branding spec (branding.py). */
:root {
  --navy: #375F86;
  --navy-deep: #2A4866;
  --red: #B61A37;
  --red-dark: #8E1429;
  --gray: #595959;
  --gray-light: #8a8a8a;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-mist: #f3f4f6;
  --border: #e3e5e8;
  --border-strong: #c8cdd4;
  --serif: 'Cambria', 'Coranto 2', 'Georgia', 'Times New Roman', serif;
  --sans: 'Calibri', 'Messina Sans', 'Helvetica Neue', 'Arial', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--gray);
  background: var(--bg-soft);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }

/* "EDGE by [EZ logo]" wordmark.
   Big serif EDGE in navy + "by" + the official EZ logo SVG inline. */
.wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.wordmark-inline {
  flex-direction: row;
  align-items: baseline;
  gap: 0.75rem;
}
.wordmark-edge {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  line-height: 1;
  padding-left: 0.25em;   /* visual centering of tracked text */
}
.wordmark-inline .wordmark-edge {
  font-size: 1.4rem;
  letter-spacing: 0.2em;
}
.wordmark-by {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wordmark-by img {
  height: 0.85rem;
  width: auto;
  vertical-align: baseline;
  transform: translateY(1px);
}
.wordmark-inline .wordmark-by img { height: 0.75rem; }

.brand {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}
h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 600; }
h2 { font-size: 1.25rem; margin: 0 0 0.5rem 0; }
.muted { color: var(--gray-light); }
.small { font-size: 0.85rem; }

.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  box-shadow: 0 2px 12px rgba(55, 95, 134, 0.06);
}
.narrow { max-width: 540px; width: 100%; }
.wide { max-width: 1100px; width: 100%; margin: 2rem auto; padding: 2rem; }

/* Header bars (survey + admin) */
.survey-topbar, .app-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header { margin: -2rem -2rem 1.5rem -2rem; }
.app-footer { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 2rem; text-align: center; }

/* Survey */
.survey-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem 1.25rem;
}
.survey-header {
  border-bottom: 2px solid var(--navy);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}
.survey-header h1 { margin: 0 0 0.25rem 0; font-size: 1.5rem; }
.survey-header .meta { font-size: 0.85rem; color: var(--gray-light); }

.progress {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  padding: 0.5rem 0;
  z-index: 10;
}
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  background: var(--navy);
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.8rem;
  color: var(--gray-light);
  margin-top: 0.35rem;
  display: flex;
  justify-content: space-between;
}

.item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem 1.5rem 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.item-id { font-size: 0.7rem; color: var(--gray-light); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.5rem; }
.item-text { color: #2d3748; font-size: 1.05rem; margin-bottom: 1rem; }
.item.touched { border-left: 3px solid var(--navy); }

.scale-options { display: grid; gap: 0.5rem; }
.scale-options label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.scale-options label:hover { background: var(--bg-soft); border-color: var(--navy); }
.scale-options input[type=radio]:checked + .opt-label { color: var(--navy); font-weight: 600; }
.scale-options label.selected { background: rgba(55,95,134,0.06); border-color: var(--navy); }
.opt-label { flex: 1; }
.opt-index { width: 1.5rem; text-align: center; color: var(--gray-light); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.ranked-row { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; align-items: center; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 0.4rem; }
.ranked-row select { padding: 0.4rem; font-family: inherit; font-size: 0.95rem; }

.molt-row { display: grid; grid-template-columns: auto auto 1fr; gap: 0.75rem; align-items: center; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 0.4rem; }
.molt-row label { font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }

textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 90px;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }

.actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 2rem; }
button {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: white;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.9; }
button.ghost { background: white; color: var(--navy); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.danger { background: var(--red); border-color: var(--red); }

.save-indicator {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--navy);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 3px;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.save-indicator.show { opacity: 1; }

.banner {
  background: rgba(182,26,55,0.08);
  border-left: 3px solid var(--red);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border-radius: 3px;
}
.banner-navy {
  background: rgba(55,95,134,0.08);
  border-left-color: var(--navy);
}

/* v0.2 survey UX */
.welcome-card { max-width: 560px; margin: 3rem auto; padding: 2.5rem 2.5rem 2rem 2.5rem; text-align: center; }
.welcome-card .brand { margin-bottom: 1.25rem; }
.welcome-card p { text-align: center; margin: 0.5rem auto; max-width: 480px; }
.welcome-h2 {
  margin: 1.75rem 0 0.75rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  font-family: var(--sans);
}
.block-list {
  list-style: none;
  counter-reset: blk;
  padding: 0;
  margin: 0 auto;
  max-width: 360px;
  text-align: left;
}
.block-list li {
  counter-increment: blk;
  padding: 0.45rem 0;
  color: var(--gray);
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.block-list li::before {
  content: counter(blk) ".";
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 1.25rem;
}
.welcome-actions { justify-content: center; gap: 0.75rem; margin-top: 1.75rem; }

.welcome-identity {
  background: rgba(55,95,134,0.06);
  border: 1px solid rgba(55,95,134,0.18);
  border-radius: 5px;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem auto 1.75rem auto;
  max-width: 440px;
  text-align: left;
}
.welcome-identity-line {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.7rem;
}
.welcome-identity-line:last-of-type { margin-bottom: 0.5rem; }
.welcome-identity-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-light);
}
.welcome-identity-value {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 600;
}
.welcome-identity-note {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(55,95,134,0.12);
  text-align: left;
}

.block-header {
  max-width: 720px;
  margin: 1.5rem auto 1rem auto;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--navy);
}
.block-header-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-light);
  margin-bottom: 0.25rem;
}
.block-header-title {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.15;
}

.centered-card { text-align: center; max-width: 540px; margin: 3rem auto; padding: 2.5rem 2rem 2rem 2rem; }
.centered-card .actions { justify-content: center; gap: 1rem; }

.item-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.75rem 1.5rem 1.5rem 1.5rem;
  margin: 1rem 0 1.5rem 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.item-card .item-text {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #2a3a4a;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: background 0.12s, border-color 0.12s;
  background: var(--bg);
}
.opt:hover { background: var(--bg-soft); border-color: var(--gray-light); }
.opt.selected { background: rgba(55,95,134,0.08); border-color: var(--navy); }
.opt input[type=radio] { margin: 0.25rem 0 0 0; flex-shrink: 0; accent-color: var(--navy); }
.opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 3px;
  background: var(--bg-mist);
  color: var(--gray-light);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.opt.selected .opt-letter { background: var(--navy); color: white; }
.opt-text { flex: 1; line-height: 1.4; color: var(--gray); }
.opt.selected .opt-text { color: #2a3a4a; }

/* QSort rows */
.qsort-instruction { margin-bottom: 0.75rem; }
.qsort-list {
  list-style: none;
  padding: 0;
  margin: 0;
  user-select: none;             /* prevent text selection during drag */
  -webkit-user-select: none;
}
.qsort-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.45rem;
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
}
.qsort-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 3px;
  background: var(--navy);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}
.qsort-text { color: #2a3a4a; line-height: 1.35; }
.qsort-handle {
  cursor: grab;
  user-select: none;
  color: var(--gray-light);
  font-size: 1.15rem;
  letter-spacing: -2px;
  padding: 0 0.5rem;
  font-weight: 700;
}
.qsort-handle:active { cursor: grabbing; }
.qsort-row { grid-template-columns: auto auto 1fr; }
.qsort-row:hover { background: var(--bg-soft); }
.qsort-row.qsort-chosen { background: rgba(55,95,134,0.08); border-color: var(--navy); box-shadow: 0 2px 8px rgba(55,95,134,0.18); }
.qsort-row.qsort-ghost { opacity: 0.3; }

textarea.open-text {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
  color: #2a3a4a;
}
textarea.open-text:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(55,95,134,0.15);
}
.open-text-counter { margin-top: 0.4rem; text-align: right; }

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 1.25rem auto 0 auto;
}
.save-hint { text-align: center; margin-top: 1rem; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
th { color: var(--gray-light); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: var(--bg-soft); }
.tag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; }
.tag.pending { background: #ececec; color: #6a6a6a; }
.tag.progress { background: #fdecc4; color: #7a5e10; }
.tag.done { background: #d4e8d4; color: #2f6a2f; }
.tag.ready { background: #d4dfea; color: #1e3a5f; }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto; gap: 0.5rem; margin-bottom: 0.5rem; align-items: end; }
.row label { font-size: 0.75rem; color: var(--gray-light); display: block; margin-bottom: 0.2rem; }
.row input, .row select { width: 100%; padding: 0.45rem; font-family: inherit; font-size: 0.9rem; border: 1px solid var(--border); border-radius: 3px; }
.section { margin-bottom: 2rem; }
.copy-btn { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.url { font-family: 'SF Mono', Menlo, monospace; font-size: 0.78rem; word-break: break-all; }
.del-btn {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--gray-light);
  border-color: var(--border);
  background: var(--bg);
}
.del-btn:hover {
  color: white;
  background: var(--red);
  border-color: var(--red);
}
.edit-pencil {
  background: transparent;
  border: none;
  padding: 0 0.25rem;
  font-size: 0.78rem;
  color: var(--navy);
  cursor: pointer;
  line-height: 1;
  opacity: 0.55;
}
.edit-pencil:hover { opacity: 1; }

.ts-member-lbl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 1rem 0.2rem 0;
  font-size: 0.85rem;
  color: var(--gray);
}
.ts-member-lbl input { accent-color: var(--navy); }
