/* ─── Meaningful Outcomes Framework v2 — WordPress plugin styles ──────────
   All selectors prefixed .mof- to avoid theme conflicts.
   ─────────────────────────────────────────────────────────────────────── */

.mof-wrap {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #1a1a1a;

  --mof-primary:      #1A4F66;
  --mof-primary-dark: #0E3645;
  --mof-primary-pale: #E6EEF2;
  --mof-accent:       #E07A2C;
  --mof-accent-dark:  #B95E18;
  --mof-muted:        #5b6b75;
  --mof-hairline:     rgba(26,79,102,0.14);
  --mof-surface:      #ffffff;
  --mof-surface-alt:  #F4F6F8;
}

.mof-wrap *, .mof-wrap *::before, .mof-wrap *::after { box-sizing: border-box; }

/* ─── App shell ────────────────────────────────────────────────────────── */

.mof-app {
  background: var(--mof-surface);
  border-radius: 6px;
  border: 1px solid var(--mof-hairline);
  box-shadow: 0 1px 2px rgba(0,60,91,.04), 0 8px 24px rgba(0,60,91,.06);
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Header ───────────────────────────────────────────────────────────── */

.mof-header {
  background: var(--mof-primary);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--mof-accent);
  flex-shrink: 0;
}

.mof-header-text { display: flex; flex-direction: column; gap: 1px; }

.mof-eyebrow {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
  font-weight: 500;
}

.mof-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  line-height: 1.3 !important;
}

.mof-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}

.mof-user-name { font-weight: 500; }

.mof-login-link {
  color: rgba(255,255,255,.85);
  text-decoration: underline;
  font-size: 12px;
}
.mof-login-link:hover { color: #fff; }

/* ─── Body grid ────────────────────────────────────────────────────────── */

.mof-body {
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 640px) {
  .mof-body { grid-template-columns: 1fr; }
}

.mof-col { display: flex; flex-direction: column; min-width: 0; }

/* ─── Sliders ──────────────────────────────────────────────────────────── */

.mof-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  margin-bottom: 10px;
}

.mof-control label {
  display: block;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mof-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.mof-row { display: flex; align-items: center; gap: 10px; }

.mof-row input[type=range] {
  flex: 1;
  accent-color: var(--mof-primary);
  height: 4px;
  margin: 0;
}

.mof-val {
  font-size: 15px;
  font-weight: 600;
  min-width: 24px;
  text-align: right;
  color: var(--mof-primary-dark);
  font-variant-numeric: tabular-nums;
}

/* ─── Preset buttons ───────────────────────────────────────────────────── */

.mof-shape-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}

.mof-shape-btns > span {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mof-muted);
  font-weight: 500;
  margin-right: 2px;
}

.mof-shape-btn {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--mof-hairline);
  background: var(--mof-surface);
  color: var(--mof-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  line-height: 1.4;
}

.mof-shape-btn:hover {
  background: var(--mof-primary-pale);
  color: var(--mof-primary-dark);
  border-color: var(--mof-primary);
}

/* ─── Canvas ───────────────────────────────────────────────────────────── */

.mof-canvas-area {
  position: relative;
  background: var(--mof-surface-alt);
  border-radius: 12px;
  border: 1px solid var(--mof-hairline);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 180px;
}

.mof-canvas { display: block; max-width: 100%; }

/* ─── Vertex inputs ────────────────────────────────────────────────────── */

.mof-vertex-group {
  position: absolute;
  transform: translate(-50%,-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.mof-vertex-label {
  background: #fff;
  border: .5px solid #1A4F66;
  border-radius: 3px;
  font-size: 9px;
  font-family: inherit;
  color: #1a1a1a;
  padding: 1px 3px;
  min-width: 18px;
  width: 18px;
  height: 14px;
  text-align: center;
  outline: none;
  line-height: 12px;
  box-sizing: content-box;
}

.mof-vertex-label:focus { border-color: #0E3645; box-shadow: 0 0 0 1px rgba(26,79,102,.3); }
.mof-vertex-label::placeholder { color: #bbb; }

.mof-score-input {
  min-width: 12px;
  width: 12px;
  height: 12px;
  font-size: 7px;
  font-family: inherit;
  border: .5px solid #E07A2C;
  border-radius: 3px;
  background: #fff;
  color: #1a1a1a;
  padding: 1px 2px;
  outline: none;
  box-sizing: content-box;
  line-height: 11px;
  -moz-appearance: textfield;
}

.mof-score-input::-webkit-outer-spin-button,
.mof-score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mof-score-input:focus { box-shadow: 0 0 0 1px rgba(224,122,44,.35); }
.mof-score-input.mof-invalid { border-color: #B85800; color: #8B4500; }

.mof-sizer       { position: absolute; visibility: hidden; white-space: pre; font-size: 7px; font-family: inherit; padding: 1px 2px; }
.mof-label-sizer { position: absolute; visibility: hidden; white-space: pre; font-size: 9px; font-family: inherit; padding: 1px 3px; }

/* ─── Stats ────────────────────────────────────────────────────────────── */

.mof-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-top: 10px;
}

.mof-stat {
  background: var(--mof-primary-pale);
  border-radius: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(26,79,102,.10);
}

.mof-stat-label {
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mof-muted);
  margin-bottom: 2px;
  font-weight: 500;
}

.mof-stat-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--mof-primary-dark);
  font-variant-numeric: tabular-nums;
}

/* ─── Sections ─────────────────────────────────────────────────────────── */

.mof-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--mof-hairline);
}

.mof-section-no-top { margin-top: 0; padding-top: 0; border-top: none; }

.mof-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mof-primary-dark);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mof-hint {
  font-size: 11px;
  color: var(--mof-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.mof-section-actions { display: flex; gap: 5px; align-items: center; }

/* ─── Save form ────────────────────────────────────────────────────────── */

.mof-save-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.mof-save-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

.mof-save-row input[type=text],
.mof-save-row select {
  font-family: inherit;
  font-size: 12px;
  padding: 5px 9px;
  border: 1px solid var(--mof-hairline);
  border-radius: 5px;
  background: var(--mof-surface);
  color: #1a1a1a;
  outline: none;
  min-width: 0;
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}

.mof-save-row select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%231A4F66' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.mof-save-row input[type=text]:focus,
.mof-save-row select:focus {
  border-color: var(--mof-primary);
  box-shadow: 0 0 0 3px rgba(26,79,102,.12);
}

.mof-subject-cell { display: flex; gap: 6px; min-width: 0; }
.mof-subject-cell select { flex: 1; min-width: 0; }
.mof-subject-cell .mof-subject-other { flex: 1; min-width: 0; display: none; }
.mof-subject-cell.mof-is-other .mof-subject-other { display: block; }
.mof-subject-cell.mof-is-other select { flex: 0 0 78px; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */

.mof-btn {
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--mof-accent);
  background: var(--mof-accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
  line-height: 1.4;
}

.mof-btn:hover       { background: var(--mof-accent-dark); border-color: var(--mof-accent-dark); }
.mof-btn:disabled    { background: #c2cbd1; border-color: #c2cbd1; cursor: not-allowed; }

.mof-btn-ghost {
  background: var(--mof-surface);
  color: var(--mof-muted);
  border-color: var(--mof-hairline);
}
.mof-btn-ghost:hover {
  background: var(--mof-primary-pale);
  color: var(--mof-primary-dark);
  border-color: var(--mof-primary);
}

.mof-btn-danger {
  background: var(--mof-surface);
  color: #8B4500;
  border-color: rgba(139,69,0,.3);
}
.mof-btn-danger:hover { background: #fbf0e0; border-color: #8B4500; }

/* ─── Sessions list ────────────────────────────────────────────────────── */

.mof-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 90px;
  overflow-y: auto;
}

.mof-loading {
  font-size: 12px;
  color: var(--mof-muted);
  padding: 8px 0;
}

.mof-session {
  display: grid;
  grid-template-columns: 14px 10px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  background: var(--mof-surface-alt);
  border: 1px solid var(--mof-hairline);
  border-radius: 5px;
  font-size: 11px;
  transition: background .12s;
}

.mof-session:hover { background: var(--mof-primary-pale); }
.mof-session.mof-unmatched { opacity: .55; }

.mof-session input[type=checkbox] { accent-color: var(--mof-primary); margin: 0; }

.mof-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,.15);
  flex-shrink: 0;
}

.mof-session-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.mof-session-label-text {
  font-weight: 600;
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mof-session-sub {
  color: var(--mof-muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mof-session-actions { display: flex; gap: 4px; }

.mof-icon-btn {
  font-size: 10px;
  font-family: inherit;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--mof-hairline);
  background: var(--mof-surface);
  color: var(--mof-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
  line-height: 1.4;
}

.mof-icon-btn:hover { background: var(--mof-primary); color: #fff; border-color: var(--mof-primary); }
.mof-icon-btn.mof-danger { color: #8B4500; border-color: rgba(139,69,0,.25); }
.mof-icon-btn.mof-danger:hover { background: #8B4500; color: #fff; border-color: #8B4500; }

.mof-empty {
  font-size: 12px;
  color: var(--mof-muted);
  padding: 12px;
  background: var(--mof-surface-alt);
  border: 1px dashed var(--mof-hairline);
  border-radius: 8px;
  text-align: center;
}

/* ─── Trend chart ──────────────────────────────────────────────────────── */

.mof-trend-wrap {
  position: relative;
  background: var(--mof-surface-alt);
  border: 1px solid var(--mof-hairline);
  border-radius: 6px;
  padding: 6px 6px 4px;
}

.mof-trend-svg { display: block; width: 100%; height: 70px; overflow: visible; }

.mof-trend-tip {
  position: absolute;
  pointer-events: none;
  background: #1a1a1a;
  color: #fff;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s;
  z-index: 5;
  transform: translate(-50%, calc(-100% - 8px));
}

.mof-trend-tip.mof-show { opacity: 1; }

/* ─── Guest notice ─────────────────────────────────────────────────────── */

.mof-guest-box {
  background: var(--mof-primary-pale);
  border: 1px solid var(--mof-hairline);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
}

.mof-guest-box p { margin: 0 0 6px; }
.mof-guest-box p:last-child { margin-bottom: 0; }
.mof-guest-box a { color: var(--mof-primary); font-weight: 600; }

/* ─── Footer ───────────────────────────────────────────────────────────── */

.mof-footer {
  flex-shrink: 0;
  padding: 8px 20px 10px;
  font-size: 9.5px;
  color: var(--mof-muted);
  text-align: center;
  border-top: 1px solid var(--mof-hairline);
  letter-spacing: .02em;
}

/* ─── Print ────────────────────────────────────────────────────────────── */

@media print {
  .mof-shape-btns, .mof-save-row, .mof-save-actions,
  .mof-section-actions, .mof-user-badge { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
